<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
    <head>
        <title>DSpace Documentation : System Administration</title>
	    <link rel="stylesheet" href="styles/site.css" type="text/css" />
        <META http-equiv="Content-Type" content="text/html; charset=UTF-8">	    
    </head>

    <body>
	    <table class="pagecontent" border="0" cellpadding="0" cellspacing="0" width="100%" bgcolor="#ffffff">
		    <tr>
			    <td valign="top" class="pagebody">
				    <div class="pageheader">
					    <span class="pagetitle">
                            DSpace Documentation : System Administration
                                                    </span>
				    </div>
				    <div class="pagesubheading">
					    This page last changed on Mar 21, 2011 by <font color="#0050B2">tdonohue</font>.
				    </div>

				    <h1><a name="SystemAdministration-DSpaceSystemDocumentation%3ASystemAdministration"></a>DSpace System Documentation: System Administration</h1>

<p>DSpace operates on several levels: as a Tomcat servlet, cron jobs, and on-demand operations. This section explains many of the on-demand operations. Some of the command operations may be also set up as cron jobs. Many of these operations are performed at the Command Line Interface (CLI) also known as the Unix prompt (<tt>$:</tt>). Future reference will use the term CLI when the use needs to be at the command line.</p>

<p>Below is the "Command Help Table". This table explains what data is contained in the individual command/help tables in the sections that follow.</p>
<div class='table-wrap'>
<table class='confluenceTable'><tbody>
<tr>
<td class='confluenceTd'> Command used: </td>
<td class='confluenceTd'> <em>The directory and where the command is to be found.</em> </td>
</tr>
<tr>
<td class='confluenceTd'> Java class: </td>
<td class='confluenceTd'> <em>The actual java program doing the work.</em> </td>
</tr>
<tr>
<td class='confluenceTd'> Arguments: </td>
<td class='confluenceTd'> <em>The required/mandatory or optional arguments available to the user.</em> </td>
</tr>
</tbody></table>
</div>


<div class='panelMacro'><table class='infoMacro'><colgroup><col width='24'><col></colgroup><tr><td valign='top'><img src="images/icons/emoticons/information.gif" width="16" height="16" align="absmiddle" alt="" border="0"></td><td><b>DSpace Command Launcher</b><br />With DSpace Release 1.6, the many commands and scripts have been replaced with a simple <tt>[dspace]/bin/dspace &lt;command&gt;</tt> command. See Application Layer chapter for the details of the <a href="Application Layer.html#ApplicationLayer-DSpaceCommandLauncher">DSpace Command Launcher</a>.</td></tr></table></div>

<p><b>Table of Contents:</b></p>
<style type='text/css'>/*<![CDATA[*/
div.rbtoc1300725952153 {margin-left: 0px;padding: 0px;}
div.rbtoc1300725952153 ul {list-style: none;margin-left: 0px;}
div.rbtoc1300725952153 li {margin-left: 0px;padding-left: 0px;}

/*]]>*/</style><div class='rbtoc1300725952153'>
<ul>
    <li><span class='TOCOutline'>1</span> <a href='#SystemAdministration-CommunityandCollectionStructureImporter'>Community and Collection Structure Importer</a></li>
<ul>
    <li><span class='TOCOutline'>1.1</span> <a href='#SystemAdministration-Limitation'>Limitation</a></li>
</ul>
    <li><span class='TOCOutline'>2</span> <a href='#SystemAdministration-PackageImporterandExporter'>Package Importer and Exporter</a></li>
<ul>
    <li><span class='TOCOutline'>2.1</span> <a href='#SystemAdministration-Ingesting'>Ingesting</a></li>
<ul>
    <li><span class='TOCOutline'>2.1.1</span> <a href='#SystemAdministration-IngestionModes%26Options'>Ingestion Modes &amp; Options</a></li>
<ul>
    <li><span class='TOCOutline'>2.1.1.1</span> <a href='#SystemAdministration-IngestingaSinglePackage'>Ingesting a Single Package</a></li>
    <li><span class='TOCOutline'>2.1.1.2</span> <a href='#SystemAdministration-IngestingMultiplePackagesatOnce'>Ingesting Multiple Packages at Once</a></li>
</ul>
    <li><span class='TOCOutline'>2.1.2</span> <a href='#SystemAdministration-Restoring%2FReplacingusingPackages'>Restoring/Replacing using Packages</a></li>
<ul>
    <li><span class='TOCOutline'>2.1.2.1</span> <a href='#SystemAdministration-DefaultRestoreMode'>Default Restore Mode</a></li>
    <li><span class='TOCOutline'>2.1.2.2</span> <a href='#SystemAdministration-Restore%2CKeepExistingMode'>Restore, Keep Existing Mode</a></li>
    <li><span class='TOCOutline'>2.1.2.3</span> <a href='#SystemAdministration-ForceReplaceMode'>Force Replace Mode</a></li>
</ul>
</ul>
    <li><span class='TOCOutline'>2.2</span> <a href='#SystemAdministration-Disseminating'>Disseminating</a></li>
<ul>
    <li><span class='TOCOutline'>2.2.1</span> <a href='#SystemAdministration-DisseminatingaSingleObject'>Disseminating a Single Object</a></li>
    <li><span class='TOCOutline'>2.2.2</span> <a href='#SystemAdministration-DisseminatingMultipleObjectsatOnce'>Disseminating Multiple Objects at Once</a></li>
</ul>
    <li><span class='TOCOutline'>2.3</span> <a href='#SystemAdministration-ArchivalInformationPackages%28AIPs%29'>Archival Information Packages (AIPs)</a></li>
    <li><span class='TOCOutline'>2.4</span> <a href='#SystemAdministration-METSpackages'>METS packages</a></li>
</ul>
    <li><span class='TOCOutline'>3</span> <a href='#SystemAdministration-ItemImporterandExporter'>Item Importer and Exporter</a></li>
<ul>
    <li><span class='TOCOutline'>3.1</span> <a href='#SystemAdministration-DSpaceSimpleArchiveFormat'>DSpace Simple Archive Format</a></li>
    <li><span class='TOCOutline'>3.2</span> <a href='#SystemAdministration-Configuringmetadata%5Cprefix%5C.xmlforDifferentSchema'>Configuring <em>metadata-[prefix].xml</em> for Different Schema</a></li>
    <li><span class='TOCOutline'>3.3</span> <a href='#SystemAdministration-ImportingItems'>Importing Items</a></li>
<ul>
    <li><span class='TOCOutline'>3.3.1</span> <a href='#SystemAdministration-AddingItemstoaCollection'>Adding Items to a Collection</a></li>
    <li><span class='TOCOutline'>3.3.2</span> <a href='#SystemAdministration-ReplacingItemsinCollection'>Replacing Items in Collection</a></li>
    <li><span class='TOCOutline'>3.3.3</span> <a href='#SystemAdministration-DeletingorUnimportingItemsinaCollection'>Deleting or Unimporting Items in a Collection</a></li>
    <li><span class='TOCOutline'>3.3.4</span> <a href='#SystemAdministration-OtherOptions'>Other Options</a></li>
</ul>
    <li><span class='TOCOutline'>3.4</span> <a href='#SystemAdministration-ExportingItems'>Exporting Items</a></li>
</ul>
    <li><span class='TOCOutline'>4</span> <a href='#SystemAdministration-TransferringItemsBetweenDSpaceInstances'>Transferring Items Between DSpace Instances</a></li>
    <li><span class='TOCOutline'>5</span> <a href='#SystemAdministration-ItemUpdate'>Item Update</a></li>
<ul>
    <li><span class='TOCOutline'>5.1</span> <a href='#SystemAdministration-DSpacesimpleArchiveFormat'>DSpace simple Archive Format</a></li>
    <li><span class='TOCOutline'>5.2</span> <a href='#SystemAdministration-ItemUpdateCommands'>ItemUpdate Commands</a></li>
<ul>
    <li><span class='TOCOutline'>5.2.1</span> <a href='#SystemAdministration-CLIExamples'>CLI Examples</a></li>
</ul>
</ul>
    <li><span class='TOCOutline'>6</span> <a href='#SystemAdministration-Registering%28NotImporting%29Bitstreams'>Registering (Not Importing) Bitstreams</a></li>
<ul>
    <li><span class='TOCOutline'>6.1</span> <a href='#SystemAdministration-AccessibleStorage'>Accessible Storage</a></li>
    <li><span class='TOCOutline'>6.2</span> <a href='#SystemAdministration-RegisteringItemsUsingtheItemImporter'>Registering Items Using the Item Importer</a></li>
    <li><span class='TOCOutline'>6.3</span> <a href='#SystemAdministration-InternalIdentificationandRetrievalofRegisteredItems'>Internal Identification and Retrieval of Registered Items</a></li>
    <li><span class='TOCOutline'>6.4</span> <a href='#SystemAdministration-ExportingRegisteredItems'>Exporting Registered Items</a></li>
    <li><span class='TOCOutline'>6.5</span> <a href='#SystemAdministration-METSExportofRegisteredItems'>METS Export of Registered Items</a></li>
    <li><span class='TOCOutline'>6.6</span> <a href='#SystemAdministration-DeletingRegisteredItems'>Deleting Registered Items</a></li>
</ul>
    <li><span class='TOCOutline'>7</span> <a href='#SystemAdministration-METSTools'>METS Tools</a></li>
<ul>
    <li><span class='TOCOutline'>7.1</span> <a href='#SystemAdministration-TheExportTool'>The Export Tool</a></li>
    <li><span class='TOCOutline'>7.2</span> <a href='#SystemAdministration-Limitations'>Limitations</a></li>
</ul>
    <li><span class='TOCOutline'>8</span> <a href='#SystemAdministration-MediaFilters%3ATransformingDSpaceContent'>MediaFilters: Transforming DSpace Content</a></li>
    <li><span class='TOCOutline'>9</span> <a href='#SystemAdministration-SubCommunityManagement'>Sub-Community Management</a></li>
    <li><span class='TOCOutline'>10</span> <a href='#SystemAdministration-BatchMetadataEditing'>Batch Metadata Editing</a></li>
<ul>
    <li><span class='TOCOutline'>10.1</span> <a href='#SystemAdministration-ExportFunction'>Export Function</a></li>
<ul>
    <li><span class='TOCOutline'>10.1.1</span> <a href='#SystemAdministration-ExportingProcess'>Exporting Process</a></li>
</ul>
    <li><span class='TOCOutline'>10.2</span> <a href='#SystemAdministration-ImportFunction'>Import Function</a></li>
<ul>
    <li><span class='TOCOutline'>10.2.1</span> <a href='#SystemAdministration-ImportingProcess'>Importing Process</a></li>
</ul>
    <li><span class='TOCOutline'>10.3</span> <a href='#SystemAdministration-TheCSVFiles'>The CSV Files</a></li>
</ul>
    <li><span class='TOCOutline'>11</span> <a href='#SystemAdministration-ChecksumChecker'>Checksum Checker</a></li>
<ul>
    <li><span class='TOCOutline'>11.1</span> <a href='#SystemAdministration-CheckerExecutionMode'>Checker Execution Mode</a></li>
    <li><span class='TOCOutline'>11.2</span> <a href='#SystemAdministration-CheckerResultsPruning'>Checker Results Pruning</a></li>
    <li><span class='TOCOutline'>11.3</span> <a href='#SystemAdministration-CheckerReporting'>Checker Reporting</a></li>
    <li><span class='TOCOutline'>11.4</span> <a href='#SystemAdministration-CronorAutomaticExecutionofChecksumChecker'>Cron or Automatic Execution of Checksum Checker</a></li>
    <li><span class='TOCOutline'>11.5</span> <a href='#SystemAdministration-AutomatedChecksumCheckers%27Results'>Automated Checksum Checkers' Results</a></li>
</ul>
    <li><span class='TOCOutline'>12</span> <a href='#SystemAdministration-Embargo'>Embargo</a></li>
    <li><span class='TOCOutline'>13</span> <a href='#SystemAdministration-BrowseIndexCreation'>Browse Index Creation</a></li>
<ul>
    <li><span class='TOCOutline'>13.1</span> <a href='#SystemAdministration-RunningtheIndexingPrograms'>Running the Indexing Programs</a></li>
    <li><span class='TOCOutline'>13.2</span> <a href='#SystemAdministration-IndexingCustomization'>Indexing Customization</a></li>
</ul>
    <li><span class='TOCOutline'>14</span> <a href='#SystemAdministration-DSpaceLogConverter'>DSpace Log Converter</a></li>
    <li><span class='TOCOutline'>15</span> <a href='#SystemAdministration-ClientStatistics'>Client Statistics</a></li>
    <li><span class='TOCOutline'>16</span> <a href='#SystemAdministration-TestDatabase'>Test Database</a></li>
    <li><span class='TOCOutline'>17</span> <a href='#SystemAdministration-Movingitems'>Moving items</a></li>
</ul></div>

<h2><a name="SystemAdministration-CommunityandCollectionStructureImporter"></a>Community and Collection Structure Importer</h2>

<p>This CLI tool gives you the ability to import a community and collection structure directory from a source XML file.</p>
<div class='table-wrap'>
<table class='confluenceTable'><tbody>
<tr>
<td class='confluenceTd'> Command used: </td>
<td class='confluenceTd'> <tt>[dspace]/bin/dspace structure-builder</tt> </td>
</tr>
<tr>
<td class='confluenceTd'> Java class: </td>
<td class='confluenceTd'> <tt>org.dspace.administer.StructBuilder</tt> </td>
</tr>
<tr>
<td class='confluenceTd'> Argument: short and long (if available) forms: </td>
<td class='confluenceTd'> Description of the argument </td>
</tr>
<tr>
<td class='confluenceTd'> <em>&#45;f</em> </td>
<td class='confluenceTd'> Source xml file. </td>
</tr>
<tr>
<td class='confluenceTd'> <em>&#45;o</em> </td>
<td class='confluenceTd'> Output xml file. </td>
</tr>
<tr>
<td class='confluenceTd'> <em>&#45;e</em> </td>
<td class='confluenceTd'> Email of DSpace Administrator. </td>
</tr>
</tbody></table>
</div>


<p>The administrator need to build the source xml document in the following format:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">&lt;import_structure&gt;
        &lt;community&gt;
                &lt;name&gt;Community Name&lt;/name&gt;
                &lt;description&gt;Descriptive text&lt;/description&gt;
                &lt;intro&gt;Introductory text&lt;/intro&gt;
                &lt;copyright&gt;Special copyright notice&lt;/copyright&gt;
                &lt;sidebar&gt;Sidebar text&lt;/sidebar&gt;
                &lt;community&gt;
                   &lt;name&gt;Sub Community Name&lt;/name&gt;
                   &lt;community&gt; ...[ad infinitum]...
                   &lt;/community&gt;
                &lt;/community&gt;
                &lt;collection&gt;
                   &lt;name&gt;Collection Name&lt;/name&gt;
                   &lt;description&gt;Descriptive text&lt;/description&gt;
                   &lt;intro&gt;Introductory text&lt;/intro&gt;
                   &lt;copyright&gt;Special copyright notice&lt;/copyright&gt;
                   &lt;sidebar&gt;Sidebar text&lt;/sidebar&gt;
                   &lt;license&gt;Special licence&lt;/license&gt;
                   &lt;provenance&gt;Provenance information&lt;/provenance&gt;
                &lt;/collection&gt;
         &lt;/community&gt;
&lt;/import_structure&gt;
</pre>
</div></div>
<p>The resulting output document will be as follows:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">&lt;import_structure&gt;
     &lt;community identifier=<span class="code-quote">"123456789/1"</span>&gt;
                &lt;name&gt;Community Name&lt;/name&gt;
                &lt;description&gt;Descriptive text&lt;/description&gt;
                &lt;intro&gt;Introductory text&lt;/intro&gt;
                &lt;copyright&gt;Special copyright notice&lt;/copyright&gt;
                &lt;sidebar&gt;Sidebar text&lt;/sidebar&gt;
                &lt;community identifier=<span class="code-quote">"123456789/2"</span>&gt;
                        &lt;name&gt;Sub Community Name&lt;/name&gt;
                        &lt;community identifier=<span class="code-quote">"123456789/3"</span>&gt; ...[ad infinitum]...
                        &lt;/community&gt;
                &lt;/community&gt;
                &lt;collection identifier=<span class="code-quote">"123456789/4"</span>&gt;
                        &lt;name&gt;Collection Name&lt;/name&gt;
                        &lt;description&gt;Descriptive text&lt;/description&gt;
                        &lt;intro&gt;Introductory text&lt;/intro&gt;
                        &lt;copyright&gt;Special copyright notice&lt;/copyright&gt;
                        &lt;sidebar&gt;Sidebar text&lt;/sidebar&gt;
                        &lt;license&gt;Special licence&lt;/license&gt;
                        &lt;provenance&gt;Provenance information&lt;/provenance&gt;
                &lt;/collection&gt;
        &lt;/community&gt;
&lt;/import_structure&gt;
</pre>
</div></div>
<p>This command-line tool gives you the ability to import a community and collection structure directly from a source XML file. It is executed as follows:</p>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">[dspace]/bin/dspace structure-builder -f /path/to/source.xml -o path/to/output.xml -e admin@user.com</pre>
</div></div>

<p>This will examine the contents of <em>source.xml</em>, import the structure into DSpace while logged in as the supplied administrator, and then output the same structure to the output file, but including the handle for each imported community and collection as an attribute.</p>

<h3><a name="SystemAdministration-Limitation"></a>Limitation</h3>

<ul>
	<li>Currently this does not export community and collection structures, although it should only be a small modification to make it do so</li>
</ul>



<h2><a name="SystemAdministration-PackageImporterandExporter"></a>Package Importer and Exporter</h2>

<p>This command-line tool gives you access to the Packager plugins. It can <em>ingest</em> a package to create a new DSpace Object (Community, Collection or Item), or <em>disseminate</em> a DSpace Object as a package.</p>

<p>To see all the options, invoke it as:</p>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">[dspace]/bin/dspace packager --help</pre>
</div></div>

<p>This mode also displays a list of the names of package ingestion and dissemination plugins that are currently installed in your DSpace.  Each Packager plugin also may allow for custom options, which may provide you more control over how a package is imported or exported.  You can see a listing of all specific packager options by invoking <tt>&#45;-help</tt> (or <tt>&#45;h</tt>) with the <tt>&#45;-type</tt> (or <tt>&#45;t</tt>) option:</p>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">[dspace]/bin/dspace packager --help --type METS</pre>
</div></div>

<p>The above example will display the normal help message, while also listing any additional options available to the "METS" packager plugin.</p>

<h3><a name="SystemAdministration-Ingesting"></a>Ingesting</h3>

<h4><a name="SystemAdministration-IngestionModes%26Options"></a>Ingestion Modes &amp; Options</h4>

<p>When ingesting packages DSpace supports several different "modes". (Please note that not all packager plugins may support all modes of ingestion)</p>
<ol>
	<li>Submit/Ingest Mode (<tt>&#45;s</tt> option, default) &#8211; submit package to DSpace in order to create a new object(s)</li>
	<li>Restore Mode (<tt>&#45;r</tt> option) &#8211; restore pre-existing object(s) in DSpace based on package(s). This also attempts to restore all handles and relationships (parent/child objects).  This is a specialized type of "submit", where the object is created with a known Handle and known relationships.</li>
	<li>Replace Mode (<tt>&#45;r &#45;f</tt> option) &#8211; replace existing object(s) in DSpace based on package(s). This also attempts to restore all handles and relationships (parent/child objects).  This is a specialized type of "restore" where the contents of existing object(s) is replaced by the contents in the AIP(s).  By default, if a normal "restore" finds the object already exists, it will back out (i.e. rollback all changes) and report which object already exists.</li>
</ol>


<h5><a name="SystemAdministration-IngestingaSinglePackage"></a>Ingesting a Single Package</h5>

<p>To ingest a single package from a file, give the command:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">[dspace]/bin/dspace packager -e [user-email] -p [parent-handle] -t [packager-name] /full/path/to/<span class="code-keyword">package</span></pre>
</div></div>
<p>Where <em>[user-email]</em> is the e-mail address of the E-Person under whose authority this runs; <em>[parent-handle]</em> is the Handle of the Parent Object into which the package is ingested, <em>[packager-name]</em> is the plugin name of the package ingester to use, and <em>/full/path/to/package</em> is the path to the file to ingest (or <em>"-"</em> to read from the standard input).</p>

<p>Here is an example that loads a PDF file with internal metadata as a package:</p>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">[dspace]/bin/dspace packager -e admin@myu.edu -p 4321/10 -t PDF thesis.pdf</pre>
</div></div>

<p>This example takes the result of retrieving a URL and ingests it:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">wget -O - http:<span class="code-comment">//alum.mit.edu/jarandom/my-thesis.pdf | [dspace]/bin/dspace packager -e admin@myu.edu -p 4321/10  -t PDF -</span></pre>
</div></div>

<h5><a name="SystemAdministration-IngestingMultiplePackagesatOnce"></a>Ingesting Multiple Packages at Once</h5>

<p>Some Packager plugins support bulk ingest functionality using the <tt>&#45;-all</tt> (or <tt>&#45;a</tt>) flag.  When <tt>&#45;-all</tt> is used, the packager will attempt to ingest all child packages referenced by the initial package (and continue on recursively).  Some examples follow:</p>
<ul>
	<li>For a Site-based package - this would ingest <b>all</b> Communities, Collections &amp; Items based on the located package files</li>
	<li>For a Community-based package - this would ingest that Community and all SubCommunities, Collections and Items based on the located package files</li>
	<li>For a Collection - this would ingest that Collection and all contained Items based on the located package files</li>
	<li>For an Item &#8211; this just ingest the Item (including all Bitstreams &amp; Bundles) based on the package file.</li>
</ul>


<p>Here is a basic example of a bulk ingest 'packager' command template:</p>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java"> [dspace]/bin/dspace packager -s -a -t AIP -e &lt;eperson&gt; -p &lt;parent-handle&gt; &lt;file-path&gt;
</pre>
</div></div>
<p>for example:</p>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java"> [dspace]/bin/dspace packager -s -a -t AIP -e admin@myu.edu -p 4321/12 collection-aip.zip
</pre>
</div></div>
<p>The above command will ingest the package named "collection-aip.zip" as a child of the specified Parent Object (handle="4321/12").  The resulting object is assigned a new Handle (since <tt>&#45;s</tt> is specified).  In addition, any child packages directly referenced by "collection-aip.zip" are also recursively ingested (a new Handle is also assigned for each child AIP).</p>

<div class='panelMacro'><table class='noteMacro'><colgroup><col width='24'><col></colgroup><tr><td valign='top'><img src="images/icons/emoticons/warning.gif" width="16" height="16" align="absmiddle" alt="" border="0"></td><td><b>Not All Packagers Support Bulk Ingest</b><br />Because the packager plugin must know how to locate all child packages from an initial package file, not all plugins can support bulk ingest.  Currently, in DSpace the following Packager Plugins support bulk ingest capabilities:
<ul>
	<li>METS Packager Plugin</li>
	<li><a href="AIP Backup and Restore.html" title="AIP Backup and Restore">AIP Packager Plugin</a></li>
</ul>
</td></tr></table></div>

<h4><a name="SystemAdministration-Restoring%2FReplacingusingPackages"></a>Restoring/Replacing using Packages</h4>

<p><b>Restoring</b> is slightly different than just <b>ingesting</b>.  When restoring, the packager makes every attempt to restore the object as it <b>used to be</b> (including its handle, parent object, etc.).</p>

<p>There are currently three restore modes:</p>
<ol>
	<li>Default Restore Mode (<tt>&#45;r</tt>) = Attempt to restore object (and optionally children). Rollback all changes if any object is found to already exist.</li>
	<li>Restore, Keep Existing Mode (<tt>&#45;r &#45;k</tt>) =  Attempt to restore object (and optionally children).  If an object is found to already exist, skip over it (and all children objects), and continue to restore all other non-existing objects.</li>
	<li>Force Replace Mode (<tt>&#45;r &#45;f</tt>) = Restore an object (and optionally children) and <b>overwrite</b> any existing objects in DSpace.  Therefore, if an object is found to already exist in DSpace, its contents are replaced by the contents of the package. <em>WARNING: This mode is potentially dangerous as it will permanently destroy any object contents that do not currently exist in the package. You may want to first perform a backup, unless you are sure you know what you are doing&#33;</em></li>
</ol>


<h5><a name="SystemAdministration-DefaultRestoreMode"></a>Default Restore Mode</h5>

<p>By default, the restore mode (<tt>&#45;r</tt> option) will rollback all changes if any object is found to already exist.  The user will be informed if which object already exists within their DSpace installation.</p>

<p>Use this 'packager' command template:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java"> [dspace]/bin/dspace packager -r -t AIP -e &lt;eperson&gt; &lt;file-path&gt;
</pre>
</div></div>
<p>For example:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java"> [dspace]/bin/dspace packager -r -t AIP -e admin@myu.edu aip4567.zip
</pre>
</div></div>

<p><em>Notice that unlike</em> <tt><em>&#45;s</em></tt> <em>option (for submission/ingesting), the</em> <tt><em>&#45;r</em></tt> <em>option does not require the Parent Object (</em><tt><em>&#45;p</em></tt> <em>option) to be specified if it can be determined from the package itself.</em></p>

<p>In the above example, the package "aip4567.zip" is restored to the DSpace installation with the Handle provided within the package itself (and added as a child of the parent object specified within the package itself).  If the object is found to already exist, all changes are rolled back (i.e. nothing is restored to DSpace)</p>

<h5><a name="SystemAdministration-Restore%2CKeepExistingMode"></a>Restore, Keep Existing Mode</h5>

<p>When the "Keep Existing" flag (<tt>&#45;k</tt> option) is specified, the restore will attempt to skip over any objects found to already exist.  It will report to the user that the object was found to exist (and was not modified or changed).  It will then continue to restore all objects which do not already exist.   This flag is most useful when attempting a bulk restore (using the <tt>&#45;-all</tt> (or <tt>&#45;a</tt>) option.</p>

<p>One special case to note:  If a Collection or Community is found to already exist, its child objects are also skipped over.  So, this mode will not auto-restore items to an existing Collection.</p>

<p>Here's an example of how to use this 'packager' command:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java"> [dspace]/bin/dspace packager -r -a -k -t AIP -e &lt;eperson&gt; &lt;file-path&gt;
</pre>
</div></div>
<p>For example:</p>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java"> [dspace]/bin/dspace packager -r -a -k -t AIP -e admin@myu.edu aip4567.zip
</pre>
</div></div>

<p>In the above example, the package "aip4567.zip" is restored to the DSpace installation with the Handle provided within the package itself (and added as a child of the parent object specified within the package itself).  In addition, any child packages referenced by "aip4567.zip" are also recursively restored (the <tt>&#45;a</tt> option specifies to also restore all child pacakges).  They are also restored with the Handles &amp; Parent Objects provided with their package.  If any object is found to already exist, it is skipped over (child objects are also skipped).  All non-existing objects are restored.</p>

<h5><a name="SystemAdministration-ForceReplaceMode"></a>Force Replace Mode</h5>

<p>When the "Force Replace" flag (<tt>&#45;f</tt> option) is specified, the restore will <b>overwrite</b> any objects found to already exist in DSpace.  In other words, existing content is deleted and then replaced by the contents of the package(s).</p>

<div class='panelMacro'><table class='warningMacro'><colgroup><col width='24'><col></colgroup><tr><td valign='top'><img src="images/icons/emoticons/forbidden.gif" width="16" height="16" align="absmiddle" alt="" border="0"></td><td><b>Potential for Data Loss</b><br />Because this mode actually <b>destroys</b> existing content in DSpace, it is potentially dangerous and may result in data loss&#33;  It is recommended to always perform a full backup (assetstore files &amp; database) before attempting to replace any existing object(s) in DSpace.</td></tr></table></div>

<p>Here's an example of how to use this 'packager' command:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java"> [dspace]/bin/dspace packager -r -f -t AIP -e &lt;eperson&gt; &lt;file-path&gt;
</pre>
</div></div>
<p>For example:</p>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java"> [dspace]/bin/dspace packager -r -f -t AIP -e admin@myu.edu aip4567.zip
</pre>
</div></div>

<p>In the above example, the package "aip4567.zip" is restored to the DSpace installation with the Handle provided within the package itself (and added as a child of the parent object specified within the package itself).  In addition, any child packages referenced by "aip4567.zip" are also recursively ingested.  They are also restored with the Handles &amp; Parent Objects provided with their package. <em>If any object is found to already exist, its contents are replaced by the contents of the appropriate package.</em></p>

<p>If any error occurs, the script attempts to rollback the entire replacement process.</p>

<h3><a name="SystemAdministration-Disseminating"></a>Disseminating</h3>

<h4><a name="SystemAdministration-DisseminatingaSingleObject"></a>Disseminating a Single Object</h4>

<p>To disseminate a single object as a package, give the command:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">[dspace]/bin/dspace packager -d -e [user-email] -i [handle] -t [packager-name] [file-path]</pre>
</div></div>
<p>Where <em>[user-email]</em> is the e-mail address of the E-Person under whose authority this runs; <em>[handle]</em> is the Handle of the Object to disseminate; <em>[packager-name]</em> is the plugin name of the package disseminator to use; and <em>[file-path]</em> is the path to the file to create (or <em>"-"</em> to write to the standard output).  For example:</p>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java"> [dspace]/bin/dspace packager -d -t METS -e admin@myu.edu -i 4321/4567 4567.zip
</pre>
</div></div>
<p>The above code will export the object of the given handle (4321/4567) into a METS file named "4567.zip".</p>

<h4><a name="SystemAdministration-DisseminatingMultipleObjectsatOnce"></a>Disseminating Multiple Objects at Once</h4>

<p>To export an object hierarchy, use the <tt>&#45;a</tt> (or <tt>&#45;-all</tt>) package parameter.</p>

<p>For example, use this 'packager' command template:</p>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java"> [dspace]/bin/dspace packager -d -a -e [user-email] -i [handle] -t [packager-name][file-path]
</pre>
</div></div>
<p>for example:</p>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java"> [dspace]/bin/dspace packager -d -a -t METS -e admin@myu.edu -i 4321/4567 4567.zip
</pre>
</div></div>
<p>The above code will export the object of the given handle (4321/4567) into a METS file named "4567.zip".  In addition it would export all children objects to the same directory as the "4567.zip" file.</p>

<h3><a name="SystemAdministration-ArchivalInformationPackages%28AIPs%29"></a>Archival Information Packages (AIPs)</h3>

<p>As of DSpace 1.7, DSpace now can backup and restore all of its contents as a set of <a href="DSpace AIP Format.html" title="DSpace AIP Format">AIP Files</a>.  This includes all Communities, Collections, Items, Groups and People in the system.</p>

<p>This feature came out of a requirement for DSpace to better integrate with DuraCloud (<a href="http://www.duracloud.org">http://www.duracloud.org</a>), and other backup storage systems.  One of these requirements is to be able to essentially "backup" local DSpace contents into the cloud (as a type of offsite backup), and "restore" those contents at a later time.</p>

<p>Essentially, this means DSpace can export the entire hierarchy (i.e. bitstreams, metadata and relationships between Communities/Collections/Items) into a relatively standard format (a METS-based, <a href="DSpace AIP Format.html" title="DSpace AIP Format">AIP format</a>). This entire hierarchy can also be re-imported into DSpace in the same format (essentially a restore of that content in the same or different DSpace installation).</p>

<p>For more information, see the section on <a href="AIP Backup and Restore.html" title="AIP Backup and Restore">AIP backup &amp; Restore for DSpace</a>.</p>

<h3><a name="SystemAdministration-METSpackages"></a>METS packages</h3>

<p>Since DSpace 1.4 release, the software includes a package disseminator and matching ingester for the DSpace METS SIP (Submission Information Package) format. They were created to help end users prepare sets of digital resources and metadata for submission to the archive using well-defined standards such as <a href="http://www.loc.gov/standards/mets/" title="METS">METS</a>, <a href="http://www.loc.gov/standards/mods/" title="MODS">MODS</a>, and <a href="http://www.loc.gov/standards/premis/" title="PREMIS">PREMIS</a>. The plugin name is <em>METS</em> by default, and it uses MODS for descriptive metadata.</p>

<p>The DSpace METS SIP profile is available at: <a href="https://wiki.duraspace.org/display/DSPACE/DSpaceMETSSIPProfile">https://wiki.duraspace.org/display/DSPACE/DSpaceMETSSIPProfile</a></p>







<h2><a name="SystemAdministration-ItemImporterandExporter"></a>Item Importer and Exporter</h2>

<p>DSpace has a set of command line tools for importing and exporting items in batches, using the DSpace simple archive format. The tools are not terribly robust, but are useful and are easily modified. They also give a good demonstration of how to implement your own item importer if desired.</p>

<h3><a name="SystemAdministration-DSpaceSimpleArchiveFormat"></a>DSpace Simple Archive Format</h3>

<p>The basic concept behind the DSpace's simple archive format is to create an archive, which is directory full of items, with a subdirectory per item. Each item directory contains a file for the item's descriptive metadata, and the files that make up the item.</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
archive_directory/
    item_000/
        dublin_core.xml         -- qualified Dublin Core metadata <span class="code-keyword">for</span> metadata fields belonging to the dc schema
        metadata_[prefix].xml   -- metadata in another schema, the prefix is the name of the schema as registered with the metadata registry
        contents                -- text file containing one line per filename
        file_1.doc              -- files to be added as bitstreams to the item
        file_2.pdf
    item_001/
        dublin_core.xml
        contents
        file_1.png
        ...
</pre>
</div></div>
<p>The <em>dublin_core.xml</em> or <em>metadata</em>[prefix].xml_file has the following format, where each metadata element has it's own entry within a <em>&lt;dcvalue&gt;</em> tagset. There are currently three tag attributes available in the <em>&lt;dcvalue&gt;</em> tagset:</p>

<ul>
	<li><em>&lt;element&gt;</em> &#45; the Dublin Core element</li>
	<li><em>&lt;qualifier&gt;</em> &#45; the element's qualifier</li>
	<li><em>&lt;language&gt;</em> &#45; (optional)ISO language code for element
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
&lt;dublin_core&gt;
    &lt;dcvalue element=<span class="code-quote">"title"</span> qualifier=<span class="code-quote">"none"</span>&gt;A Tale of Two Cities&lt;/dcvalue&gt;
    &lt;dcvalue element=<span class="code-quote">"date"</span> qualifier=<span class="code-quote">"issued"</span>&gt;1990&lt;/dcvalue&gt;
    &lt;dcvalue element=<span class="code-quote">"title"</span> qualifier=<span class="code-quote">"alternate"</span> language=<span class="code-quote">"fr"</span>&gt;J'aime les Printemps&lt;/dcvalue&gt;
&lt;/dublin_core&gt;

</pre>
</div></div>
<p>(Note the optional language tag attribute which notifies the system that the optional title is in French.)</p></li>
</ul>


<p>Every metadata field used, must be registered via the metadata registry of the DSpace instance first.</p>

<p>The <em>contents</em> file simply enumerates, one file per line, the bitstream file names. See the following example:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
        file_1.doc
        file_2.pdf
        license
</pre>
</div></div>
<p>Please notice that the <em>license</em> is optional, and if you wish to have one included, you can place the file in the .../item_001/ directory, for example.</p>

<p>The bitstream name may optionally be followed by the sequence:</p>

<p><em>\tbundle:bundlename</em></p>

<p>where '\t' is the tab character and 'bundlename' is replaced by the name of the bundle to which the bitstream should be added. If no bundle is specified, the bitstream will be added to the 'ORIGINAL' bundle.</p>


<h3><a name="SystemAdministration-Configuringmetadata%5Cprefix%5C.xmlforDifferentSchema"></a>Configuring <em>metadata-[prefix].xml</em> for Different Schema</h3>

<p>It is possible to use other Schema such as EAD, VRA Core, etc. Make sure you have defined the new scheme in the DSpace Metada Schema Registry.</p>
<ol>
	<li>Create a separate file for the other schema named "<em>metadata-[prefix].xml</em>", where the <em>{prefix}</em> is replaced with the schema's prefix.</li>
	<li>Inside the xml file use the dame Dublin Core <em>syntax</em>, but on the <em>&lt;dublin_core&gt;</em> element include the attribute "<em>schema={prefix}</em>".</li>
	<li>Here is an example for ETD metadata, which would be in the file "<em>metadata_etd.xml"</em>:
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">&lt;?xml version=<span class="code-quote">"1.0"</span> encoding=<span class="code-quote">"UTF-8"</span>?&gt;
&lt;dublin_core schema=<span class="code-quote">"etd"</span>&gt;
     &lt;dcvalue element=<span class="code-quote">"degree"</span> qualifier=<span class="code-quote">"department"</span>&gt;Computer Science&lt;/dcvalue&gt;
     &lt;dcvalue element=<span class="code-quote">"degree"</span> qualifier=<span class="code-quote">"level"</span>&gt;Masters&lt;/dcvalue&gt;
     &lt;dcvalue element=<span class="code-quote">"degree"</span> qualifier=<span class="code-quote">"grantor"</span>&gt;Texas A &amp; M&lt;/dcvalue&gt;
&lt;/dublin_core&gt;</pre>
</div></div></li>
</ol>



<h3><a name="SystemAdministration-ImportingItems"></a>Importing Items</h3>

<p>Before running the item importer over items previously exported from a DSpace instance, please first refer to Transferring Items Between DSpace Instances.</p>
<div class='table-wrap'>
<table class='confluenceTable'><tbody>
<tr>
<td class='confluenceTd'> Command used: </td>
<td class='confluenceTd'> <tt>[dspace]/bin/dspace import</tt> </td>
</tr>
<tr>
<td class='confluenceTd'> Java class: </td>
<td class='confluenceTd'> <tt>org.dspace.app.itemimport.ItemImport</tt> </td>
</tr>
<tr>
<td class='confluenceTd'> Arguments short and (long) forms: </td>
<td class='confluenceTd'> Description </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>&#45;a or &#45;-add</tt> </td>
<td class='confluenceTd'> Add items to DSpace ‡ </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>&#45;r or &#45;-replace</tt> </td>
<td class='confluenceTd'> Replace items listed in mapfile ‡ </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>&#45;d or &#45;-delete</tt> </td>
<td class='confluenceTd'> Delete items listed in mapfile ‡ </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>&#45;s or &#45;-source</tt> </td>
<td class='confluenceTd'> Source of the items (directory) </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>&#45;c or &#45;-collection</tt> </td>
<td class='confluenceTd'> Destination Collection by their Handle or database ID </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>&#45;m or &#45;-mapfile</tt> </td>
<td class='confluenceTd'> Where the mapfile for items can be found (name and directory) </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>&#45;e or &#45;-eperson</tt> </td>
<td class='confluenceTd'> Email of eperson doing the importing </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>&#45;w or &#45;-workflow</tt> </td>
<td class='confluenceTd'> Send submission through collection's workflow </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>&#45;n or &#45;-notify</tt> </td>
<td class='confluenceTd'> Kicks off the email alerting of the item(s) has(have) been imported </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>&#45;t or &#45;-test</tt> </td>
<td class='confluenceTd'> Test run‚ do not actually import items </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>&#45;p or &#45;-template</tt> </td>
<td class='confluenceTd'> Apply the collection template </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>&#45;R or &#45;-resume</tt> </td>
<td class='confluenceTd'> Resume a failed import (Used on Add only) </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>&#45;h or &#45;-help</tt> </td>
<td class='confluenceTd'> Command help </td>
</tr>
</tbody></table>
</div>


<p>‡ These are mutually exclusive.</p>

<p>The item importer is able to batch import unlimited numbers of items for a particular collection using a very simple CLI command and 'arguments'</p>

<h4><a name="SystemAdministration-AddingItemstoaCollection"></a>Adding Items to a Collection</h4>

<p>To add items to a collection, you gather the following information:</p>

<ul>
	<li>eperson</li>
	<li>Collection ID (either Handle (e.g. 123456789/14) or Database ID (e.g. 2)</li>
	<li>Source directory where the items reside</li>
	<li>Mapfile. Since you don't have one, you need to determine where it will be (e.g. /Import/Col_14/mapfile)<br/>
At the command line:</li>
</ul>


<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">[dspace]/bin/dspace <span class="code-keyword">import</span> --add --eperson=joe@user.com --collection=CollectionID --source=items_dir --mapfile=mapfile</pre>
</div></div>

<p>or by using the short form:</p>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">[dspace]/bin/dspace <span class="code-keyword">import</span> -a -e joe@user.com -c CollectionID -s items_dir -m mapfile</pre>
</div></div>

<p>The above command would cycle through the archive directory's items, import them, and then generate a map file which stores the mapping of item directories to item handles. <b>SAVE THIS MAP FILE.</b> Using the map file you can use it for replacing or deleting (unimporting) the file.</p>

<p><b>Testing.</b> You can add <tt>&#45;-test</tt> (or <tt>&#45;t</tt>) to the command to simulate the entire import process without actually doing the import. This is extremely useful for verifying your import files before doing the actual import.</p>


<h4><a name="SystemAdministration-ReplacingItemsinCollection"></a>Replacing Items in Collection</h4>

<p>Replacing existing items is relatively easy. Remember that mapfile you were <em>supposed</em> to save? Now you will use it. The command (in short form):</p>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">[dspace]/bin/dspace <span class="code-keyword">import</span> -r -e joe@user.com -c collectionID -s items_dir -m mapfile</pre>
</div></div>

<p>Long form:</p>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">[dspace]/bin/dspace <span class="code-keyword">import</span> --replace --eperson=joe@user.com --collection=collectionID --source=items_dire --mapfile=mapfile</pre>
</div></div>


<h4><a name="SystemAdministration-DeletingorUnimportingItemsinaCollection"></a>Deleting or Unimporting Items in a Collection</h4>

<p>You are able to unimport or delete items provided you have the mapfile. Remember that mapfile you were <em>supposed</em> to save? The command is (in short form):</p>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">[dspace]/bin/dspace <span class="code-keyword">import</span> -d -m mapfile</pre>
</div></div>

<p>In long form:</p>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">[dspace]/bin/dspace <span class="code-keyword">import</span> --delete --mapfile mapfile</pre>
</div></div>


<h4><a name="SystemAdministration-OtherOptions"></a>Other Options</h4>

<ul>
	<li><b>Workflow</b>. The importer usually bypasses any workflow assigned to a collection. But add the <tt>&#45;-workflow</tt> (<tt>&#45;w</tt>) argument will route the imported items through the workflow system.</li>
</ul>


<ul>
	<li><b>Templates</b>. If you have templates that have constant data and you wish to apply that data during batch importing, add the <tt>&#45;-template</tt> (<tt>&#45;p</tt>) argument.</li>
</ul>


<ul>
	<li><b>Resume</b>. If, during importing, you have an error and the import is aborted, you can use the <tt>&#45;-resume</tt> (<tt>&#45;R</tt>) flag that you can try to resume the import where you left off after you fix the error.</li>
</ul>




<h3><a name="SystemAdministration-ExportingItems"></a>Exporting Items</h3>

<p>The item exporter can export a single item or a collection of items, and creates a DSpace simple archive for each item to be exported.</p>
<div class='table-wrap'>
<table class='confluenceTable'><tbody>
<tr>
<td class='confluenceTd'> Command used: </td>
<td class='confluenceTd'> <tt>[dspace]/bin/dspace export</tt> </td>
</tr>
<tr>
<td class='confluenceTd'> Java class: </td>
<td class='confluenceTd'> <em>org.dspace.app.itemexport.ItemExport</em> </td>
</tr>
<tr>
<td class='confluenceTd'> Arguments short and (long) forms: </td>
<td class='confluenceTd'> Description </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>&#45;t</tt> or <tt>&#45;-type</tt> </td>
<td class='confluenceTd'> Type of export. <em>COLLECTION</em> will inform the program you want the whole collection. <em>ITEM</em> will be only the specific item. (You will actually key in the keywords in all caps. See examples below.) </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>&#45;i</tt> or <tt>&#45;-id</tt> </td>
<td class='confluenceTd'> The ID or Handle of the Collection or Item to export. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>&#45;d</tt> or <tt>&#45;-dest</tt> </td>
<td class='confluenceTd'> The destination of where you want the file of items to be placed. You place the path if necessary. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>&#45;n</tt> or <tt>&#45;-number</tt> </td>
<td class='confluenceTd'> Sequence number to begin export the items with. Whatever number you give, this will be the name of the first directory created for your export. The layout of the export is the same as you would set your layout for an Import. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>&#45;m</tt> or <tt>&#45;-migrate</tt> </td>
<td class='confluenceTd'> Export the item/collection for migration. This will remove the handle and metadata that will be re-created in the new instance of DSpace. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>&#45;h</tt> or <tt>&#45;-help</tt> </td>
<td class='confluenceTd'> Brief Help. </td>
</tr>
</tbody></table>
</div>


<p><b>Exporting a Collection</b></p>

<p>To export a collection's items you type at the CLI:</p>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">[dspace]/bin/dspace export --type=COLLECTION --id=collID --dest=dest_dir --number=seq_num</pre>
</div></div>

<p>Short form:</p>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">[dspace]/bin/dspace export -t COLLECTION -d CollID or Handle -d /path/to/destination -n Some_number</pre>
</div></div>

<p><b>Exporting a Single Item</b></p>

<p>The keyword <em>COLLECTION</em> means that you intend to export an entire collection. The ID can either be the database ID or the handle. The exporter will begin numbering the simple archives with the sequence number that you supply. To export a single item use the keyword <em>ITEM</em> and give the item ID as an argument:</p>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">[dspace]/bin/dspace export --type=ITEM --id=itemID --dest=dest_dir --number=seq_num</pre>
</div></div>

<p>Short form:</p>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">[dspace]/bin/dspace export -t ITEM -i itemID or Handle -d /path/to/destination -n some_number</pre>
</div></div>

<p>Each exported item will have an additional file in its directory, named 'handle'. This will contain the handle that was assigned to the item, and this file will be read by the importer so that items exported and then imported to another machine will retain the item's original handle.</p>

<p><b>The</b> <tt><b>&#45;m</b></tt> <b>Argument</b></p>

<p>Using the <tt>&#45;m</tt> argument will export the item/collection and also perform the migration step. It will perform the same process that the next section Transferring Items Between DSpace Instances  performs. We recommend that the next section be read in conjunction with this flag being used.</p>



<h2><a name="SystemAdministration-TransferringItemsBetweenDSpaceInstances"></a>Transferring Items Between DSpace Instances</h2>

<p><b>Migration of Data</b><br/>
Where items are to be moved between DSpace instances (for example from a test DSpace into a production DSpace) the item exporter and item importer can be used in conjunction with a script to assist in this process.</p>

<p>After running the item exporter each <em>dublin_core.xml</em> file will contain metadata that was automatically added by DSpace. These fields are as follows:</p>

<ul>
	<li>date.accessioned</li>
	<li>date.available</li>
	<li>date.issued</li>
	<li>description.provenance</li>
	<li>format.extent</li>
	<li>format.mimetype</li>
	<li>identifier.uri<br/>
In order to avoid duplication of this metadata, run</li>
</ul>


<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">[dspace]/bin/dspace_migrate &lt;/path/to/exported item directory&gt;</pre>
</div></div>

<p>prior to running the item importer. This will remove the above metadata items, except for date.issued - if the item has been published or publicly distributed before and <em>identifier.uri</em> &#45; if it is not the handle, from the <em>dublin_core.xml</em> file and remove all <em>handle</em> files. It will then be safe to run the item exporter.</p>


<h2><a name="SystemAdministration-ItemUpdate"></a>Item Update</h2>

<p>ItemUpdate is a batch-mode command-line tool for altering the metadata and bitstream content of existing items in a DSpace instance. It is a companion tool to ItemImport and uses the DSpace simple archive format to specify changes in metadata and bitstream contents. Those familiar with generating the source trees for ItemImporter will find a similar environment in the use of this batch processing tool.</p>

<p>For metadata, ItemUpdate can perform 'add' and 'delete' actions on specified metadata elements. For bitstreams, 'add' and 'delete' are similarly available. All these actions can be combined in a single batch run.</p>

<p>ItemUpdate supports an undo feature for all actions except bitstream deletion. There is also a test mode, as with ItemImport. However, unlike ItemImport, there is no resume feature for incomplete processing. There is more extensive logging with a summary statement at the end with counts of successful and unsuccessful items processed.</p>

<p>One probable scenario for using this tool is where there is an external primary data source for which the DSpace instance is a secondary or down-stream system. Metadata and/or bitstream content changes in the primary system can be exported to the simple archive format to be used by ItemUpdate to synchronize the changes.</p>

<p>A note on terminology: <b>item</b> refers to a DSpace item. <b>metadata element</b> refers generally to a qualified or unqualified element in a schema in the form <em>[schema].[element].[qualifier]</em> or <em>[schema].[element]</em> and occasionally in a more specific way to the second part of that form. <b>metadata field</b> refers to a specific instance pairing a metadata element to a value.</p>

<h3><a name="SystemAdministration-DSpacesimpleArchiveFormat"></a>DSpace simple Archive Format</h3>

<p>As with ItemImporter, the idea behind the DSpace's simple archive format is to create an archive directory with a subdirectory per item. There are a few additional features added to this format specifically for ItemUpdate. Note that in the simple archive format, the item directories are merely local references and only used by ItemUpdate in the log output.</p>

<p>The user is referred to the previous section DSpace Simple Archive Format.</p>

<p>Additionally, the use of a <b>delete_contents</b> is now available. This file lists the bitstreams to be deleted, one bitstream ID per line. Currently, no other identifiers for bitstreams are usable for this function. This file is an addition to the Archive format specifically for ItemUpdate.</p>

<p>The optional suppress_undo file is a flag to indicate that the 'undo archive' should not be written to disk. This file is usually written by the application in an undo archive to prevent a recursive undo. This file is an addition to the Archive format specifically for ItemUpdate.</p>


<h3><a name="SystemAdministration-ItemUpdateCommands"></a>ItemUpdate Commands</h3>

<div class='table-wrap'>
<table class='confluenceTable'><tbody>
<tr>
<td class='confluenceTd'> Command used: </td>
<td class='confluenceTd'> <tt>[dspace]/bin/dspace itemupdate</tt> </td>
</tr>
<tr>
<td class='confluenceTd'> Java class: </td>
<td class='confluenceTd'> <em>org.dspace.app.itemimport.ItemUpdate</em> </td>
</tr>
<tr>
<td class='confluenceTd'> Arguments short and (long) forms: </td>
<td class='confluenceTd'> Description </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>&#45;a</tt> or <tt>&#45;-addmetadata [metadata element]</tt> </td>
<td class='confluenceTd'> Repeatable for multiple elements. The metadata element should be in the form dc.x or dc.x.y. The mandatory argument indicates the metadata fields in the dublin_core.xml file to be added unless already present. However, duplicate fields will not be added to the item metadata without warning or error. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>&#45;d</tt> or <tt>&#45;-deletemetadata [metadata element]</tt> </td>
<td class='confluenceTd'> Repeatable for multiple elements. All metadata fields matching the element will be deleted. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>&#45;A</tt> or <tt>&#45;-addbitstream</tt> </td>
<td class='confluenceTd'> Adds bitstreams listed in the contents file with the bitstream metadata cited there. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>&#45;D</tt> or <tt>&#45;-deletebitstream [filter plug classname or alias]</tt> </td>
<td class='confluenceTd'> Not repeatable. With no argument, this operation deletes bitstreams listed in the <em>deletes_contents</em> file. Only bitstream ids are recognized identifiers for this operatiotn. The optional filter argument is the classname of an implementation of <em>org.dspace.app.itemdupate.BitstreamFilter</em> class to identify files for deletion or one of the aliases (ORIGINAL, ORIGINAL_AND_DERIVATIVES, TEXT, THUMBNAIL) which reference existing filters based on membership in a bundle of that name. IN this case, the <em>delete_contents</em> file is not required for any item. The filter properties file will contains properties pertinent to the particular filer used. Multiple filters are not allowed. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>&#45;h</tt> or <tt>&#45;-help</tt> </td>
<td class='confluenceTd'> Displays brief command line help. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>&#45;e</tt> or <tt>&#45;-eperson</tt> </td>
<td class='confluenceTd'> Email address of the person or the user's database ID <b>(Required)</b> </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>&#45;s</tt> or <tt>&#45;-source</tt> </td>
<td class='confluenceTd'> Directory archive to process <b>(Required)</b> </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>&#45;i</tt> or <tt>&#45;-itemidentifier</tt> </td>
<td class='confluenceTd'> Specifies an alternate metadata field (not a handle) used to hold an identifier used to match the DSpace item with that in the archive. If omitted, the item handle is expected to be located in the <em>dc.identifier.uri</em> field. (Optional) </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>&#45;t</tt> or <tt>&#45;-test</tt> </td>
<td class='confluenceTd'> Runs the process in test mode with logging but no changes applied to the DSpace instance. (Optional) </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>&#45;P</tt> or <tt>&#45;-alterprovenance</tt> </td>
<td class='confluenceTd'> Prevents any changes to the provenance field to represent changes in the bitstream content resulting from an Add or Delete. No provenance statements are written for thumbnails or text derivative bitstreams, in keeping with the practice of MediaFilterManager. (Optional) </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>&#45;F</tt> or <tt>&#45;-filterproperties</tt> </td>
<td class='confluenceTd'> The filter properties files to be used by the delete bitstreams action (Optional) </td>
</tr>
</tbody></table>
</div>



<h4><a name="SystemAdministration-CLIExamples"></a>CLI Examples</h4>

<p><b>Adding Metadata</b>:</p>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">[dspace]/bin/dspace itemupdate -e joe@user.com -s [path/to/archive] -a dc.description</pre>
</div></div>

<p><em>This will add from your archive the dc element description based on the handle from the URI (since the</em> <tt><em>&#45;i</em></tt> <em>argument wasn't used).</em></p>



<h2><a name="SystemAdministration-Registering%28NotImporting%29Bitstreams"></a>Registering (Not Importing) Bitstreams</h2>

<p>Registration is an alternate means of incorporating items, their metadata, and their bitstreams into DSpace by taking advantage of the bitstreams already being in storage accessible to DSpace. An example might be that there is a repository for existing digital assets. Rather than using the normal interactive ingest process or the batch import to furnish DSpace the metadata and to upload bitstreams, registration provides DSpace the metadata and the location of the bitstreams. DSpace uses a variation of the import tool to accomplish registration.</p>

<h3><a name="SystemAdministration-AccessibleStorage"></a>Accessible Storage</h3>

<p>To register an item its bitstreams must reside on storage accessible to DSpace and therefore referenced by an asset store number in <em>dspace.cfg</em>. The configuration file <em>dspace.cfg</em> establishes one or more asset stores through the use of an integer asset store number. This number relates to a directory in the DSpace host's file system or a set of SRB account parameters. This asset store number is described in The <em>dspace.cfg</em> Configuration Properties File section and in the <em>dspace.cfg</em> file itself. The asset store number(s) used for registered items should generally not be the value of the <em>assetstore.incoming</em> property since it is unlikely that you will want to mix the bitstreams of normally ingested and imported items and registered items.</p>


<h3><a name="SystemAdministration-RegisteringItemsUsingtheItemImporter"></a>Registering Items Using the Item Importer</h3>

<p>DSpace uses the same import tool that is used for batch import except that several variations are employed to support registration. The discussion that follows assumes familiarity with the import tool.</p>

<p>The archive format for registration does not include the actual content files (bitstreams) being registered. The format is however a directory full of items to be registered, with a subdirectory per item. Each item directory contains a file for the item's descriptive metadata (<em>dublin_core.xml</em>) and a file listing the item's content files (<em>contents</em>), but not the actual content files themselves.</p>

<p>The <em>dublin_core.xml</em> file for item registration is exactly the same as for regular item import.</p>

<p>The <em>contents</em> file, like that for regular item import, lists the item's content files, one content file per line, but each line has the one of the following formats:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">-r -s n -f filepath
-r -s n -f filepath\tbundle:bundlename
-r -s n -f filepath\tbundle:bundlename\tpermissions: -[r|w] 'group name'
-r -s n -f filepath\tbundle:bundlename\tpermissions: -[r|w] 'group	name'\tdescription: some text</pre>
</div></div>
<p>where</p>

<ul>
	<li><em>&#45;r</em> indicates this is a file to be registered</li>
	<li><em>&#45;s n</em> indicates the asset store number (<em>n</em>)</li>
	<li><em>&#45;f filepath</em> indicates the path and name of the content file to be registered (filepath)</li>
	<li><em>\t</em> is a tab character</li>
	<li><em>bundle:bundlename</em> is an optional bundle name</li>
	<li><em>permissions: &#45;[r&#124;w] 'group name'</em> is an optional read or write permission that can be attached to the bitstream</li>
	<li><em>description: some text</em> is an optional description field to add to the file<br/>
The bundle, that is everything after the filepath, is optional and is normally not used.</li>
</ul>


<p>The command line for registration is just like the one for regular import:</p>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">[dspace]/bin/dspace <span class="code-keyword">import</span> -a -e joe@user.com -c collectionID -s items_dir -m mapfile</pre>
</div></div>

<p>(or by using the long form)</p>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">[dspace]/bin/dspace <span class="code-keyword">import</span> --add --eperson=joe@user.com --collection=collectionID --source=items_dir --map=mapfile</pre>
</div></div>

<p>The <tt>&#45;-workflow</tt> and <tt>&#45;-test</tt> flags will function as described in <a href="#SystemAdministration-ImportingItems">Importing Items</a>.</p>

<p>The <tt>&#45;-delete</tt> flag will function as described in Importing Items but the registered content files will not be removed from storage. See Deleting Registered Items.</p>

<p>The <tt>&#45;-replace</tt> flag will function as described in Importing Items but care should be taken to consider different cases and implications. With old items and new items being registered or ingested normally, there are four combinations or cases to consider. Foremost, an old registered item deleted from DSpace using <tt>&#45;-replace</tt> will not be removed from the storage. See Deleting Registered Items. where is resides. A new item added to DSpace using <tt>&#45;-replace</tt> will be ingested normally or will be registered depending on whether or not it is marked in the <em>contents</em> files with the <tt>&#45;r</tt>.</p>


<h3><a name="SystemAdministration-InternalIdentificationandRetrievalofRegisteredItems"></a>Internal Identification and Retrieval of Registered Items</h3>

<p>Once an item has been registered, superficially it is indistinguishable from items ingested interactively or by batch import. But internally there are some differences:</p>

<p>First, the randomly generated internal ID is not used because DSpace does not control the file path and name of the bitstream. Instead, the file path and name are that specified in the <em>contents</em> file.</p>

<p>Second, the <em>store_number</em> column of the bitstream database row contains the asset store number specified in the <em>contents</em> file.</p>

<p>Third, the <em>internal_id</em> column of the bitstream database row contains a leading flag (<em>&#45;R</em>) followed by the registered file path and name. For example, <em>&#45;Rfilepath</em> where <em>filepath</em> is the file path and name relative to the asset store corresponding to the asset store number. The asset store could be traditional storage in the DSpace server's file system or an SRB account.</p>

<p>Fourth, an MD5 checksum is calculated by reading the registered file if it is in local storage. If the registerd file is in remote storage (say, SRB) a checksum is calculated on just the file name&#33; This is an efficiency choice since registering a large number of large files that are in SRB would consume substantial network resources and time. A future option could be to have an SRB proxy process calculate MD5s and store them in SRB's metadata catalog (MCAT) for rapid retrieval. SRB offers such an option but it's not yet in production release.</p>

<p>Registered items and their bitstreams can be retrieved transparently just like normally ingested items.</p>


<h3><a name="SystemAdministration-ExportingRegisteredItems"></a>Exporting Registered Items</h3>

<p>Registered items may be exported as described in Exporting Items. If so, the export directory will contain actual copies of the files being exported but the lines in the contents file will flag the files as registered. This means that if DSpace items are "round tripped" (see Transferring Items Between DSpace Instances) using the exporter and importer, the registered files in the export directory will again registered in DSpace instead of being uploaded and ingested normally.</p>


<h3><a name="SystemAdministration-METSExportofRegisteredItems"></a>METS Export of Registered Items</h3>

<p>The METS Export Tool can also be used but note the cautions described in that section and note that MD5 values for items in remote storage are actually MD5 values on just the file name.</p>


<h3><a name="SystemAdministration-DeletingRegisteredItems"></a>Deleting Registered Items</h3>

<p>If a registered item is deleted from DSpace, either interactively or by using the <em>&#45;</em><em><del>delete</del></em> or <em>&#45;replace</em> flags described in Importing Items, the item will disappear from DSpace but it's registered content files will remain in place just as they were prior to registration. Bitstreams not registered but added by DSpace as part of registration, such as <em>license.txt</em> files, will be deleted.</p>



<h2><a name="SystemAdministration-METSTools"></a>METS Tools</h2>

<div class='panelMacro'><table class='warningMacro'><colgroup><col width='24'><col></colgroup><tr><td valign='top'><img src="images/icons/emoticons/forbidden.gif" width="16" height="16" align="absmiddle" alt="" border="0"></td><td><b>These Tools are Obsolete</b><br />These METS Export Tools are now Obsolete.  They have been replaced by the METS Packager Plugin tools, which are able to both export and import METS files.  See the <a href="#SystemAdministration-PackageImporterandExporter">Package Importer and Exporter</a> section for more details.</td></tr></table></div>

<p>The experimental (incomplete) METS export tool writes DSpace items to a filesystem with the metadata held in a more standard format based on METS.</p>

<h3><a name="SystemAdministration-TheExportTool"></a>The Export Tool</h3>

<p><b>This tool is obsolete. Its use is strongly discouraged.  Please use the</b> <b><a href="#SystemAdministration-PackageImporterandExporter">Package Importer and Exporter</a></b> <b>instead.</b></p>

<p>The following are examples of the types of process the METS tool can provide.</p>

<p><b>Exporting an individual item.</b> From the CLI:</p>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">[dspace]/bin/dspace org.dspace.app.mets.METSExport -i [handle] -d /path/to/destination</pre>
</div></div>

<p><b>Exporting a collection</b>. From the CLI:</p>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">[dspace]/bin/dspace org.dspace.app.mets.METSExport -c [handle] -d /path/to/destination</pre>
</div></div>

<p><b>Exporting all the items in DSpace.</b> From the CLI:</p>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">[dspace]/bin/dspace org.dspace.app.mets.METSExport -a -d /path/to/destination</pre>
</div></div>

<h3><a name="SystemAdministration-Limitations"></a>Limitations</h3>

<ul>
	<li>No corresponding import tool yet</li>
	<li>No <em>structmap</em> section</li>
	<li>Some technical metadata not written, e.g. the primary bitstream in a bundle, original filenames or descriptions.</li>
	<li>Only the MIME type is stored, not the (finer grained) bitstream format.</li>
	<li>Dublin Core to MODS mapping is very simple, probably needs verification</li>
</ul>



<h2><a name="SystemAdministration-MediaFilters%3ATransformingDSpaceContent"></a>MediaFilters: Transforming DSpace Content</h2>

<p>DSpace can apply filters to content/bitstreams, creating new content. Filters are included that extract text for <b>full-text searching</b>, and create <b>thumbnails</b> for items that contain images. The media filters are controlled by the <em>MediaFilterManager</em> which traverses the asset store, invoking the <em>MediaFilter</em> or <em>FormatFilter</em> classes on bitstreams. The media filter plugin configuration <em>filter.plugins</em> in <em>dspace.cfg</em> contains a list of all enabled media/format filter plugins (see Configuring Media Filters for more information). The media filter system is intended to be run from the command line (or regularly as a cron task):</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">[dspace]/bin/dspace filter-media</pre>
</div></div>
<p>With no options, this traverses the asset store, applying media filters to bitstreams, and skipping bitstreams that have already been filtered.</p>

<p><b>Available Command-Line Options:</b></p>

<ul>
	<li><b>Help</b> : <em>[dspace]/bin/dspace filter-media &#45;h</em>
	<ul>
		<li>Display help message describing all command-line options.</li>
	</ul>
	</li>
	<li><b>Force mode</b> : <em>[dspace]/bin/dspace filter-media &#45;f</em>
	<ul>
		<li>Apply filters to ALL bitstreams, even if they've already been filtered. If they've already been filtered, the previously filtered content is overwritten.</li>
	</ul>
	</li>
	<li><b>Identifier mode</b> : <em>[dspace]/bin/dspace filter-media &#45;i 123456789/2</em>
	<ul>
		<li>Restrict processing to the community, collection, or item named by the identifier - by default, all bitstreams of all items in the repository are processed. The identifier must be a Handle, not a DB key. This option may be combined with any other option.</li>
	</ul>
	</li>
	<li><b>Maximum mode</b> : <em>[dspace]/bin/dspace filter-media &#45;m 1000</em>
	<ul>
		<li>Suspend operation after the specified maximum number of items have been processed - by default, no limit exists. This option may be combined with any other option.</li>
	</ul>
	</li>
	<li><b>No-Index mode</b> : <em>[dspace]/bin/dspace filter-media &#45;n</em>
	<ul>
		<li>Suppress index creation - by default, a new search index is created for full-text searching. This option suppresses index creation if you intend to run <em>index-update</em> elsewhere.</li>
	</ul>
	</li>
	<li><b>Plugin mode</b> : <em>[dspace]/bin/dspace filter-media &#45;p "PDF Text Extractor","Word Text Extractor"</em>
	<ul>
		<li>Apply ONLY the filter plugin(s) listed (separated by commas). By default all named filters listed in the <em>filter.plugins</em> field of <em>dspace.cfg</em> are applied. This option may be combined with any other option. <em>WARNING:</em> multiple plugin names must be separated by a comma (i.e. ',') and NOT a comma followed by a space (i.e. ', ').</li>
	</ul>
	</li>
	<li><b>Skip mode</b> : <em>[dspace]/bin/dspace filter-media &#45;s 123456789/9,123456789/100</em>
	<ul>
		<li>SKIP the listed identifiers (separated by commas) during processing. The identifiers must be Handles (not DB Keys). They may refer to items, collections or communities which should be skipped. This option may be combined with any other option. <em>WARNING:</em> multiple identifiers must be separated by a comma (i.e. <em>','</em>) and NOT a comma followed by a space (i.e. <em>', '</em>).</li>
		<li>NOTE: If you have a large number of identifiers to skip, you may maintain this comma-separated list within a separate file (e.g. <em>filter-skiplist.txt</em>). Use the following format to call the program. <em>Please note the use of the "grave" or "tick" (</em>`_) symbol and do not use the single quotation. _
		<ul>
			<li><em>[dspace]/bin/dspace filter-media &#45;s `less filter-skiplist.txt`</em></li>
		</ul>
		</li>
	</ul>
	</li>
	<li><b>Verbose mode</b> : <em>[dspace]/bin/dspace filter-media &#45;v</em>
	<ul>
		<li>Verbose mode - print all extracted text and other filter details to STDOUT.<br/>
Adding your own filters is done by creating a class which <em>implements</em> the <em>org.dspace.app.mediafilter.FormatFilter</em> interface. See the Creating a new Media Filter topic and comments in the source file FormatFilter.java for more information. In theory filters could be implemented in any programming language (C, Perl, etc.) However, they need to be invoked by the Java code in the Media Filter class that you create.</li>
	</ul>
	</li>
</ul>



<h2><a name="SystemAdministration-SubCommunityManagement"></a>Sub-Community Management</h2>

<p>DSpace provides an administrative tool‚ 'CommunityFiliator'‚ for managing community sub-structure. Normally this structure seldom changes, but prior to the 1.2 release sub-communities were not supported, so this tool could be used to place existing pre-1.2 communities into a hierarchy. It has two operations, either establishing a community to sub-community relationship, or dis-establishing an existing relationship.</p>

<p>The familiar parent/child metaphor can be used to explain how it works. Every community in DSpace can be either a 'parent' community‚ meaning it has at least one sub-community, or a 'child' community‚ meaning it is a sub-community of another community, or both or neither. In these terms, an 'orphan' is a community that lacks a parent (although it can be a parent); 'orphans' are referred to as 'top-level' communities in the DSpace user-interface, since there is no parent community 'above' them. The first operation‚ establishing a parent/child relationship - can take place between any community and an orphan. The second operation - removing a parent/child relationship‚ will make the child an orphan.</p>
<div class='table-wrap'>
<table class='confluenceTable'><tbody>
<tr>
<td class='confluenceTd'> Command used: </td>
<td class='confluenceTd'> <tt>[dspace]/bin/dspace community-filiator</tt> </td>
</tr>
<tr>
<td class='confluenceTd'> Java class: </td>
<td class='confluenceTd'> <em>org.dspace.administer.CommunityFiliator</em> </td>
</tr>
<tr>
<td class='confluenceTd'> Arguments short and (long) forms: </td>
<td class='confluenceTd'> Description </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>&#45;s</tt> or <tt>&#45;-set</tt> </td>
<td class='confluenceTd'> Set a parent/child relationship </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>&#45;r</tt> or <tt>&#45;-remove</tt> </td>
<td class='confluenceTd'> Remove a parent/child relationship </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>&#45;c</tt> or <tt>&#45;-child</tt> </td>
<td class='confluenceTd'> Child community (Handle or database ID) </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>&#45;p</tt> or <tt>&#45;-parent</tt> </td>
<td class='confluenceTd'> Parent community (Handle or database ID </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>&#45;h</tt> or <tt>&#45;-help</tt> </td>
<td class='confluenceTd'> Online help. </td>
</tr>
</tbody></table>
</div>


<p><b>Set</b> a parent/child relationship, issue the following at the CLI:</p>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">dspace community-filiator --set --parent=parentID --child=childID</pre>
</div></div>

<p>(or using the short form)</p>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">[dspace]/bin/dspace community-filiator -s -p parentID -c childID</pre>
</div></div>

<p>where '<del>s' or '</del>&#45;set' means establish a relationship whereby the community identified by the '-p' parameter becomes the parent of the community identified by the '-c' parameter. Both the 'parentID' and 'childID' values may be handles or database IDs.</p>

<p>The reverse operation looks like this:</p>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">[dspace]/bin/dspace community-filiator --remove --parent=parentID --child=childID</pre>
</div></div>

<p>(or using the short form)</p>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">[dspace]/bin/dspace community-filiator -r -p parentID -c childID</pre>
</div></div>

<p>where '<del>r' or '</del>&#45;remove' means dis-establish the current relationship in which the community identified by 'parentID' is the parent of the community identified by 'childID'. The outcome will be that the 'childID' community will become an orphan, i.e. a top-level community.</p>

<p>If the required constraints of operation are violated, an error message will appear explaining the problem, and no change will be made. An example in a removal operation, where the stated child community does not have the stated parent community as its parent: "Error, child community not a child of parent community".</p>

<p>It is possible to effect arbitrary changes to the community hierarchy by chaining the basic operations together. For example, to move a child community from one parent to another, simply perform a 'remove' from its current parent (which will leave it an orphan), followed by a 'set' to its new parent.</p>

<p>It is important to understand that when any operation is performed, all the sub-structure of the child community follows it. Thus, if a child has itself children (sub-communities), or collections, they will all move with it to its new 'location' in the community tree.</p>


<h2><a name="SystemAdministration-BatchMetadataEditing"></a>Batch Metadata Editing</h2>

<p>DSpace provides a batch metadata editing tool. The batch editing tool is able to produce a comma delimited file in the CVS format. The batch editing tool facilitates the user to perform the following:</p>

<ul>
	<li>Batch editing of metadata (e.g. perform an external spell check)</li>
	<li>Batch additions of metadata (e.g. add an abstract to a set of items, add controlled vocabulary such as LCSH)</li>
	<li>Batch find and replace of metadata values (e.g. correct misspelled surname across several records)</li>
	<li>Mass move items between collections</li>
	<li>Enable the batch addition of new items (without bitstreams) via a CSV file</li>
	<li>Re-order the values in a list (e.g. authors)
<h3><a name="SystemAdministration-ExportFunction"></a>Export Function</h3></li>
</ul>


<p>The following table summarizes the basics.</p>
<div class='table-wrap'>
<table class='confluenceTable'><tbody>
<tr>
<td class='confluenceTd'> Command used: </td>
<td class='confluenceTd'> <tt>[dspace]/bin/dspace metadata-export</tt> </td>
</tr>
<tr>
<td class='confluenceTd'> Java class: </td>
<td class='confluenceTd'> org.dspace.app.bulkedit.MetadataExport </td>
</tr>
<tr>
<td class='confluenceTd'> Arguments short and (long) forms): </td>
<td class='confluenceTd'> Description </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>&#45;f</tt> or <tt>&#45;-file</tt> </td>
<td class='confluenceTd'> Required. The filename of the resulting CSV. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>&#45;i</tt> or <tt>&#45;-id</tt> </td>
<td class='confluenceTd'> The Item, Collection, or Community handle or Database ID to export. If not specified, <b>all</b> items will be exported. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>&#45;a</tt> or <tt>&#45;-all</tt> </td>
<td class='confluenceTd'> Include all the metadata fields that are not normally changed (e.g. provenance) or those fields you configured in the <tt>dspace.cfg</tt> to be ignored on export. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>&#45;h</tt> or <tt>&#45;-help</tt> </td>
<td class='confluenceTd'> Display the help page. </td>
</tr>
</tbody></table>
</div>


<h4><a name="SystemAdministration-ExportingProcess"></a>Exporting Process</h4>

<p>To run the batch editing exporter, at the command line:</p>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">[dspace]/bin/dspace metadata-export -f name_of_file.csv -i 1023/24</pre>
</div></div>

<p>Example:</p>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">[dspace]/bin/dspace metadata-export -f /batch_export/col_14.csv -i /1989.1/24</pre>
</div></div>

<p>In the above example we have requested that a collection, assigned handle '<em>1989.1/24</em>' export the entire collection to the file '<em>col_14.cvs</em>' found in the '<em>/batch_export</em>' directory.</p>



<h3><a name="SystemAdministration-ImportFunction"></a>Import Function</h3>

<p>The following table summarizes the basics.</p>
<div class='table-wrap'>
<table class='confluenceTable'><tbody>
<tr>
<td class='confluenceTd'> Command used: </td>
<td class='confluenceTd'> <tt>[dspace]/bin/dspace metadata-import</tt> </td>
</tr>
<tr>
<td class='confluenceTd'> Java class: </td>
<td class='confluenceTd'> org.dspace.app.bulkedit.MetadataImport </td>
</tr>
<tr>
<td class='confluenceTd'> Arguments short and (long) forms: </td>
<td class='confluenceTd'> Description </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>&#45;f</tt> or <tt>&#45;-file</tt> </td>
<td class='confluenceTd'> Required. The filename of the CSV file to load. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>&#45;s</tt> or <tt>&#45;-silent</tt> </td>
<td class='confluenceTd'> Silent mode. The import function does not prompt you to make sure you wish to make the changes. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>&#45;e</tt> or <tt>&#45;-email</tt> </td>
<td class='confluenceTd'> The email address of the user. This is only required when adding new items. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>&#45;w</tt> or <tt>&#45;-workflow</tt> </td>
<td class='confluenceTd'> When adding new items, the program will queue the items up to use the Collection Workflow processes. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>&#45;n</tt> or <tt>&#45;-notify</tt> </td>
<td class='confluenceTd'> when adding new items using a workflow, send notification emails. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>&#45;t</tt> or <tt>&#45;-template</tt> </td>
<td class='confluenceTd'> When adding new items, use the Collection template, if it exists. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>&#45;h</tt> or <tt>&#45;-help</tt> </td>
<td class='confluenceTd'> Display the brief help page. </td>
</tr>
</tbody></table>
</div>


<p>Silent Mode should be used carefully. It is possible (and probable) that you can overlay the wrong data and cause irreparable damage to the database.</p>

<h4><a name="SystemAdministration-ImportingProcess"></a>Importing Process</h4>

<p>To run the batch importer, at the command line:</p>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">[dspace]/bin/dspace metadata-<span class="code-keyword">import</span> -f name_of_file.csv </pre>
</div></div>

<p>Example</p>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">[dspace]/bin/dspace metadata-<span class="code-keyword">import</span> -f /dImport/col_14.csv</pre>
</div></div>

<p>If you are wishing to upload new metadata <b>without</b> bitstreams, at the command line:</p>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">[dspace]/bin/dspace/metadata-<span class="code-keyword">import</span> -f /dImport/new_file.csv -e joe@user.com -w -n -t</pre>
</div></div>

<p>In the above example we threw in all the arguments. This would add the metadata and engage the workflow, notification, and templates to all be applied to the items that are being added.</p>

<div class='panelMacro'><table class='infoMacro'><colgroup><col width='24'><col></colgroup><tr><td valign='top'><img src="images/icons/emoticons/information.gif" width="16" height="16" align="absmiddle" alt="" border="0"></td><td><b>Importing large CSV files</b><br />It is not recommended to import CSV files of more than 1,000 lines.&nbsp; When importing files larger than this, it is hard to accurately verify the changes that the import tool states it will make, and large files may cause 'Out Of Memory' errors part way through the process.</td></tr></table></div>



<h3><a name="SystemAdministration-TheCSVFiles"></a>The CSV Files</h3>

<p>The csv files that this tool can import and export abide by the RFC4180 CSV format <a href="http://www.ietf.org/rfc/rfc4180.txt" title="http://www.ietf.org/rfc/rfc4180.txt">http://www.ietf.org/rfc/rfc4180.txt</a>. This means that new lines, and embedded commas can be included by wrapping elements in double quotes. Double quotes can be included by using two double quotes. The code does all this for you, and any good csv editor such as Excel or OpenOffice will comply with this convention.</p>

<p><b>File Structure.</b> The first row of the csv must define the metadata values that the rest of the csv represents. The first column must always be "id" which refers to the item's id. All other columns are optional. The other columns contain the dublin core metadata fields that the data is to reside.</p>

<p>A typical heading row looks like:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">id,collection,dc.title,dc.contributor,dc.date.issued,etc,etc,etc.</pre>
</div></div>
<p>Subsequent rows in the csv file relate to items. A typical row might look like:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">350,2292,Item title,<span class="code-quote">"Smith, John"</span>,2008</pre>
</div></div>
<p>If you want to store multiple values for a given metadata element, they can be separated with the double-pipe '&#124;&#124;' (or another character that you defined in your &#95;dspace.cfg &#95;file. For example:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">Horses||Dogs||Cats</pre>
</div></div>
<p>Elements are stored in the database in the order that they appear in the csv file. You can use this to order elements where order may matter, such as authors, or controlled vocabulary such as Library of Congress Subject Headings.</p>

<p>When importing a csv file, the importer will <em>overlay</em> the data onto what is already in the repository to determine the differences. It only acts on the contents of the csv file, rather than on the complete item metadata. This means that the CSV file that is exported can be manipulated quite substantially before being re-imported. Rows (items) or Columns (metadata elements) can be removed and will be ignored. For example, if you only want to edit item abstracts, you can remove all of the other columns and just leave the abstract column. (You do need to leave the ID column intact. This is mandatory).</p>

<p><b>Editing collection membership.</b> Items can be moved between collections by editing the collection handles in the 'collection' column. Multiple collections can be included. The first collection is the 'owning collection'. The owning collection is the primary collection that the item appears in. Subsequent collections (separated by the field separator) are treated as mapped collections. These are the same as using the map item functionality in the DSpace user interface. To move items between collections, or to edit which other collections they are mapped to, change the data in the collection column.</p>

<p><b>Adding items.</b> New metadata-only items can be added to DSpace using the batch metadata importer. To do this, enter a plus sign '+' in the first 'id' column. The importer will then treat this as a new item. If you are using the command line importer, you will need to use the &#45;e flag to specify the user email address or id of the user that is registered as submitting the items.</p>

<p><b>Deleting Data.</b> It is possible to perform deletes across the board of certain metadata fields from an exported file. For example, let's say you have used keywords (dc.subject) that need to be removed <em>en masse</em>. You would leave the column (dc.subject) intact, but remove the data in the corresponding rows.</p>

<p><b>Migrating Data or Exchanging data.</b> It is possible that you have data in one Dublin Core (DC) element and you wish to really have it in another. An example would be that your staff have input Library of Congress Subject Headings in the Subject field (dc.subject) instead of the LCSH field (dc.subject.lcsh). Follow these steps and your data is migrated upon import:</p>

<ol>
	<li>Insert a new column. The first row should be the new metadata element. (We will refer to it as the TARGET)</li>
	<li>Select the column/rows of the data you wish to change. (We will refer to it as the SOURCE)</li>
	<li>Cut and paste this data into the new column (TARGET) you created in Step 1.</li>
	<li>Leave the column (SOURCE) you just cut and pasted from empty. Do not delete it.</li>
</ol>



<h2><a name="SystemAdministration-ChecksumChecker"></a>Checksum Checker</h2>

<p>Checksum Checker is program that can run to verify the checksum of every item within DSpace. Checksum Checker was designed with the idea that most System Administrators will run it from the cron. Depending on the size of the repository choose the options wisely.</p>
<div class='table-wrap'>
<table class='confluenceTable'><tbody>
<tr>
<td class='confluenceTd'> Command used: </td>
<td class='confluenceTd'> <tt>[dspace]/bin/dspace checker</tt> </td>
</tr>
<tr>
<td class='confluenceTd'> Java class: </td>
<td class='confluenceTd'> org.dspace.app.checker.ChecksumChecker </td>
</tr>
<tr>
<td class='confluenceTd'> Arguments short and (long) forms): </td>
<td class='confluenceTd'> Description </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>&#45;L</tt> or <tt>&#45;-continuous</tt> </td>
<td class='confluenceTd'> Loop continuously through the bitstreams </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>&#45;a</tt> or <tt>&#45;-handle</tt> </td>
<td class='confluenceTd'> Specify a handle to check </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>&#45;b &lt;bitstream-ids&gt;</tt> </td>
<td class='confluenceTd'> Space separated list of bitstream IDs </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>&#45;c</tt> or <tt>&#45;-count</tt> </td>
<td class='confluenceTd'> Check count </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>&#45;d</tt> or <tt>&#45;-duration</tt> </td>
<td class='confluenceTd'> Checking duration </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>&#45;h</tt> or <tt>&#45;-help</tt> </td>
<td class='confluenceTd'> Calls online help </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>&#45;l</tt> or <tt>&#45;-looping</tt> </td>
<td class='confluenceTd'> Loop once through bitstreams </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>&#45;p &lt;prune&gt;</tt> </td>
<td class='confluenceTd'> Prune old results (optionally using specified properties file for configuration </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>&#45;v</tt> or <tt>&#45;-verbose</tt> </td>
<td class='confluenceTd'> Report all processing </td>
</tr>
</tbody></table>
</div>


<p>There are three aspects of the Checksum Checker's operation that can be configured:</p>

<ul>
	<li>the execution mode</li>
	<li>the logging output</li>
	<li>the policy for removing old checksum results from the database<br/>
The user should refer to Chapter 5. Configuration for specific configuration beys in the <em>dspace.cfg</em> file.</li>
</ul>


<h3><a name="SystemAdministration-CheckerExecutionMode"></a>Checker Execution Mode</h3>

<p>Execution mode can be configured using command line options. Information on the options are found in the previous table above. The different modes are described below.</p>

<p>Unless a particular bitstream or handle is specified, the Checksum Checker will always check bitstreams in order of the least recently checked bitstream. (Note that this means that the most recently ingested bitstreams will be the last ones checked by the Checksum Checker.)</p>

<p><b>Available command line options</b></p>

<ul>
	<li><b>Limited-count mode:</b> <tt>[dspace]/bin/dspace checker &#45;c</tt> To check a specific number of bitstreams. The <em>&#45;c</em> option if followed by an integer, the number of bitstreams to check. Example: <tt>[dspace/bin/dspace checker &#45;c 10</tt> This is particularly useful for checking that the checker is executing properly. The Checksum Checker's default execution mode is to check a single bitstream, as if the option was <em>&#45;c 1</em></li>
	<li><b>Duration mode:</b> <tt>[dspace]/bin/dspace checker &#45;d</tt> To run the Check for a specific period of time with a time argument. You may use any of the time arguments below: Example: <tt>[dspace/bin/dspace checker &#45;d 2h</tt> (Checker will run for 2 hours)
<div class='table-wrap'>
<table class='confluenceTable'><tbody>
<tr>
<td class='confluenceTd'> s </td>
<td class='confluenceTd'> Seconds </td>
</tr>
<tr>
<td class='confluenceTd'> m </td>
<td class='confluenceTd'> Minutes </td>
</tr>
<tr>
<td class='confluenceTd'> h </td>
<td class='confluenceTd'> Hours </td>
</tr>
<tr>
<td class='confluenceTd'> d </td>
<td class='confluenceTd'> Days </td>
</tr>
<tr>
<td class='confluenceTd'> w </td>
<td class='confluenceTd'> Weeks </td>
</tr>
<tr>
<td class='confluenceTd'> y </td>
<td class='confluenceTd'> Years </td>
</tr>
</tbody></table>
</div>

<p>The checker will keep starting new bitstream checks for the specific durations, so actual execution duration will be slightly longer than the specified duration. Bear this in mind when scheduling checks.</p></li>
	<li><b>Specific Bitstream mode:</b> <tt>[dspace]/bin/dspace checker &#45;b</tt> Checker will only look at the internal bitstream IDs. Example: <tt>[dspace]/bin/dspace checker &#45;b 112 113 4567</tt> Checker will only check bitstream IDs 112, 113 and 4567.</li>
	<li><b>Specific Handle mode:</b> <tt>[dspace]/bin/dspace checker &#45;a</tt> Checker will only check bitstreams within the Community, Community or the item itself. Example: <tt>[dspace]/bin/dspace checker &#45;a 123456/999</tt> Checker will only check this handle. If it is a Collection or Community, it will run through the entire Collection or Community.</li>
	<li><b>Looping mode:</b> <tt>[dspace]/bin/dspace checker &#45;l</tt> or <tt>[dspace]/bin/dspace checker &#45;L</tt> There are two modes. The lowercase 'el' (-l) specifies to check every bitstream in the repository once. This is recommended for smaller repositories who are able to loop through all their content in just a few hours maximum. An uppercase 'L' (-L) specifies to continuously loops through the repository. This is not recommended for most repository systems. <b>Cron Jobs</b>. For large repositories that cannot be completely checked in a couple of hours, we recommend the &#45;d option in cron.</li>
	<li><b>Pruning mode:</b> <tt>[dspace]/bin/dspace checker &#45;p</tt> The Checksum Checker will store the result of every check in the checksum_history table. By default, successful checksum matches that are eight weeks old or older will be deleted when the &#45;p option is used. (Unsuccessful ones will be retained indefinitely). Without this option, the retention settings are ignored and the database table may grow rather large&#33;</li>
</ul>


<h3><a name="SystemAdministration-CheckerResultsPruning"></a>Checker Results Pruning</h3>

<p>As stated above in "Pruning mode", the checksum_history table can get rather large, and that running the checker with the &#45;p assists in the size of the checksum_history being kept manageable. The amount of time for which results are retained in the checksum_history table can be modified by one of two methods:</p>

<ol>
	<li>Editing the retention policies in <tt>[dspace]/config/dspace.cfg</tt> See Chapter 5 Configuration for the property keys. OR</li>
	<li>Pass in a properties file containing retention policies when using the &#45;p option.To do this, create a file with the following two property keys: 
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">checker.retention.<span class="code-keyword">default</span> = 10y
checker.retention.CHECKSUM_MATCH = 8w</pre>
</div></div>
<p>You can use the table above for your time units. At the command line: <tt>[dspace]/bin/dspace checker &#45;p retention_file_name &lt;ENTER&gt;</tt></p></li>
</ol>


<h3><a name="SystemAdministration-CheckerReporting"></a>Checker Reporting</h3>

<p>Checksum Checker uses log4j to report its results. By default it will report to a log called <tt>[dspace]/log/checker.log</tt>, and it will report only on bitstreams for which the newly calculated checksum does not match the stored checksum. To report on all bitstreams checked regardless of outcome, use the <em>&#45;v</em> (verbose) command line option:</p>

<p><tt>[dspace]/bin/dspace checker &#45;l &#45;v</tt> (This will loop through the repository once and report in detail about every bitstream checked.</p>

<p>To change the location of the log, or to modify the prefix used on each line of output, edit the <tt>[dspace]/config/templates/log4j.properties</tt> file and run <tt>[dspace]/bin/install_configs</tt>.</p>


<h3><a name="SystemAdministration-CronorAutomaticExecutionofChecksumChecker"></a>Cron or Automatic Execution of Checksum Checker</h3>

<p>You should schedule the Checksum Checker to run automatically, based on how frequently you backup your DSpace instance (and how long you keep those backups). The size of your repository is also a factor. For very large repositories, you may need to schedule it to run for an hour (e.g. <tt>&#45;d 1h</tt> option) each evening to ensure it makes it through your entire repository within a week or so. Smaller repositories can likely get by with just running it weekly.</p>

<p><b>Unix, Linux, or MAC OS</b>. You can schedule it by adding a cron entry similar to the following to the crontab for the user who installed DSpace:</p>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">0 4 * * 0 [dspace]/bin/dspace checker -d2h -p</pre>
</div></div>

<p>The above cron entry would schedule the checker to run the checker every Sunday at 400 (4:00 a.m.) for 2 hours. It also specifies to 'prune' the database based on the retention settings in <em>dspace.cfg</em>.</p>

<p><b>Windows OS</b>. You will be unable to use the checker shell script. Instead, you should use Windows Schedule Tasks to schedule the following command to run at the appropriate times:</p>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">[dspace]/bin/dspace checker -d2h -p</pre>
</div></div>
<p>(This command should appear on a single line).</p>


<h3><a name="SystemAdministration-AutomatedChecksumCheckers%27Results"></a>Automated Checksum Checkers' Results</h3>

<p>Optionally, you may choose to receive automated emails listing the Checksum Checkers' results. Schedule it to run <b>after</b> the Checksum Checker has completed its processing (otherwise the email may not contain all the results).</p>
<div class='table-wrap'>
<table class='confluenceTable'><tbody>
<tr>
<td class='confluenceTd'> Command used: </td>
<td class='confluenceTd'> <tt>[dspace]/bin/dspace checker-emailer</tt> </td>
</tr>
<tr>
<td class='confluenceTd'> Java class: </td>
<td class='confluenceTd'> org.dspace.checker.DailyReportEmailer </td>
</tr>
<tr>
<td class='confluenceTd'> Arguments short and (long) forms): </td>
<td class='confluenceTd'> Description </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>&#45;a</tt> or <tt>&#45;-All</tt> </td>
<td class='confluenceTd'> Send all the results (everything specified below) </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>&#45;d</tt> or <tt>&#45;-Deleted</tt> </td>
<td class='confluenceTd'> Send E-mail report for all bitstreams set as deleted for today. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>&#45;m</tt> or <tt>&#45;-Missing</tt> </td>
<td class='confluenceTd'> Send E-mail report for all bitstreams not found in assetstore for today. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>&#45;c</tt> or <tt>&#45;-Changed</tt> </td>
<td class='confluenceTd'> Send E-mail report for all bitstreams where checksum has been changed for today. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>&#45;u</tt> or <tt>&#45;-Unchanged</tt> </td>
<td class='confluenceTd'> Send the Unchecked bitstream report. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>&#45;n</tt> or <tt>&#45;-Not Processed</tt> </td>
<td class='confluenceTd'> Send E-mail report for all bitstreams set to longer be processed for today. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>&#45;h</tt> or <tt>&#45;-help</tt> </td>
<td class='confluenceTd'> Help </td>
</tr>
</tbody></table>
</div>


<p>You can also combine options (e.g. <tt>&#45;m &#45;c</tt>) for combined reports.</p>

<p><b>Cron</b>. Follow the same steps above as you would running checker in cron. Change the time but match the regularity. Remember to schedule this <b>after</b> Checksum Checker has run.</p>



<h2><a name="SystemAdministration-Embargo"></a>Embargo</h2>

<p>If you have implemented the Embargo feature, you will need to run it periodically to check for Items with expired embargoes and lift them.</p>
<div class='table-wrap'>
<table class='confluenceTable'><tbody>
<tr>
<td class='confluenceTd'> Command used: </td>
<td class='confluenceTd'> <tt>[dspace]/bin/dspace embargo-lifter</tt> </td>
</tr>
<tr>
<td class='confluenceTd'> Java class: </td>
<td class='confluenceTd'> org.dspace.embargo.EmbargoManager </td>
</tr>
<tr>
<td class='confluenceTd'> Arguments short and (long) forms): </td>
<td class='confluenceTd'> Description </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>&#45;c</tt> or <tt>&#45;-check</tt> </td>
<td class='confluenceTd'> ONLY check the state of embargoed Items, do NOT lift any embargoes </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>&#45;i</tt> or <tt>&#45;-identifier</tt> </td>
<td class='confluenceTd'> Process ONLY this handle identifier(s), which must be an Item. Can be repeated. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>&#45;l</tt> or <tt>&#45;-lift</tt> </td>
<td class='confluenceTd'> Only lift embargoes, do NOT check the state of any embargoed items. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>&#45;n</tt> or <tt>&#45;-dryrun</tt> </td>
<td class='confluenceTd'> Do no change anything in the data model, print message instead. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>&#45;v</tt> or <tt>&#45;-verbose</tt> </td>
<td class='confluenceTd'> Print a line describing the action taken for each embargoed item found. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>&#45;q</tt> or <tt>&#45;-quiet</tt> </td>
<td class='confluenceTd'> No output except upon error. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>&#45;h</tt> or <tt>&#45;-help</tt> </td>
<td class='confluenceTd'> Display brief help screen. </td>
</tr>
</tbody></table>
</div>


<p>You must run the Embargo Lifter task periodically to check for items with expired embargoes and lift them from being embargoed. For example, to check the status, at the CLI:</p>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">[dspace]/bin/dspace embargo-lifter -c</pre>
</div></div>

<p>To lift the actual embargoes on those items that meet the time criteria, at the CLI:</p>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">[dspace]/bin/dspace embargo-lifter -l</pre>
</div></div>


<h2><a name="SystemAdministration-BrowseIndexCreation"></a>Browse Index Creation</h2>

<p>To create all the various browse indexes that you define in the Configuration Section (Chapter 5) there are a variety of options available to you. You can see these options below in the command table.</p>
<div class='table-wrap'>
<table class='confluenceTable'><tbody>
<tr>
<td class='confluenceTd'> Command used: </td>
<td class='confluenceTd'> _<em>[dspace]</em>_<em>/bin/dspace index-init</em> </td>
</tr>
<tr>
<td class='confluenceTd'> Java class: </td>
<td class='confluenceTd'> org.dspace.browse.IndexBrowse </td>
</tr>
<tr>
<td class='confluenceTd'> Arguments short and long forms): </td>
<td class='confluenceTd'> Description </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>&#45;r</tt> or <tt>&#45;rebuild</tt> </td>
<td class='confluenceTd'> Should we rebuild all the indexes, which removes old tables and creates new ones. For use with <tt>&#45;f</tt>. Mutually exclusive with <tt>&#45;d</tt> </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>&#45;s</tt> or <tt>&#45;start</tt> </td>
<td class='confluenceTd'> <tt>[-s &lt;int&gt;] start from this index number and work upwards (mostly only useful for debugging). For use with {{-t</tt> and <tt>&#45;f</tt> </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>&#45;x</tt> or <tt>&#45;execute</tt> </td>
<td class='confluenceTd'> Execute all the remove and create SQL against the database. For use with <tt>&#45;t</tt> and <tt>&#45;f</tt> </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>&#45;i</tt> or <tt>&#45;index</tt> </td>
<td class='confluenceTd'> Actually do the indexing. Mutually exclusive with <tt>&#45;t</tt> and <tt>&#45;f</tt>. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>&#45;o</tt> or <tt>&#45;out</tt> </td>
<td class='confluenceTd'> <tt>[-o&lt;filename&gt;]</tt> write the remove and create SQL to the given file. For use with <tt>&#45;t</tt> and <tt>&#45;f</tt> </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>&#45;p</tt> or <tt>&#45;print</tt> </td>
<td class='confluenceTd'> Write the remove and create SQL to the stdout. For use with <tt>&#45;t</tt> and <tt>&#45;f</tt>. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>&#45;t</tt> or <tt>&#45;tables</tt> </td>
<td class='confluenceTd'> Create the tables only, do no attempt to index. Mutually exclusive with <tt>&#45;f</tt> and <tt>&#45;i</tt> </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>&#45;f</tt> or <tt>&#45;full</tt> </td>
<td class='confluenceTd'> Make the tables, and do the indexing. This forces <tt>&#45;x</tt>. Mutually exclusive with <tt>&#45;f</tt> and <tt>&#45;i</tt>. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>&#45;v</tt> or <tt>&#45;verbose</tt> </td>
<td class='confluenceTd'> Print extra information to the stdout. If used in conjunction with <tt>&#45;p</tt>, you cannot use the stdout to generate your database structure. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>&#45;d</tt> or <tt>&#45;delete</tt> </td>
<td class='confluenceTd'> Delete all the indexes, but do not create new ones. For use with <tt>&#45;f</tt>. This is mutually exclusive with <tt>&#45;r</tt>. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>&#45;h</tt> or <tt>&#45;help</tt> </td>
<td class='confluenceTd'> Show this help documentation. Overrides all other arguments. </td>
</tr>
</tbody></table>
</div>


<h3><a name="SystemAdministration-RunningtheIndexingPrograms"></a>Running the Indexing Programs</h3>

<p><b>Complete Index Regeneration</b>. By running <tt>[dspace]/bin/dspace index-init</tt> you will completely regenerate your indexes, tearing down all old tables and reconstructing with the new configuration.</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">[dspace]/bin/dspace index-init</pre>
</div></div>

<p><b>Updating the Indexes</b>. By running <tt>[dspace]/bin/dspace index-update</tt> you will reindex your full browse without modifying the table structure. (This should be your default approach if indexing, for example, via a cron job periodically).</p>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">[dspace]/bin/dspace index-update</pre>
</div></div>

<p><b>Destroy and rebuild.</b> You can destroy and rebuild the database, but do not do the indexing. Output the SQL to do this to the screen and a file, as well as executing it against the database, while being verbose. At the CLI screen:</p>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">[dspace]/bin/dspace index \-r \-t \-p \-v \-x \-o myfile.sql</pre>
</div></div>


<h3><a name="SystemAdministration-IndexingCustomization"></a>Indexing Customization</h3>

<p>DSpace provides robust browse indexing. It is possible to expand upon the default indexes delivered at the time of the installation. The System Administrator should review "Defining the Indexes" from the Chapter 5. Configuration to become familiar with the property keys and the definitions used therein before attempting heavy customizations.</p>

<p>Through customization is is possible to:</p>

<ul>
	<li>Add new browse indexes besides the four that are delivered upon installation. Examples:
	<ul>
		<li>Series</li>
		<li>Specific subject fields (Library of Congress Subject Headings.<em>(It is possible to create a browse index based on a controlled vocabulary or thesaurus.)</em></li>
		<li>Other metadata schema fields</li>
	</ul>
	</li>
	<li>Combine metadata fields into one browse</li>
	<li>Combine different metadata schemas in one browse<br/>
<b>Examples of new browse indexes that are possible.</b><em>(The system administrator is reminded to read the section on Defining the Indexes in Chapter 5. Configuration.)</em></li>
</ul>


<ul>
	<li><b>Add a Series Browse</b>. You want to add a new browse using a previously unused metadata element. <em>webui.browse.index.6 = series:metadata:dc.relation.ispartofseries:text:single_Note: the index # need to be adjusted to your browse stanza in the &#95;dspace.cfg</em> file. Also, you will need to update your <em>Messages.properties</em> file.</li>
	<li><b>Combine more than one metadata field into a browse.</b> You may have other title fields used in your repository. You may only want one or two of them added, not all title fields. And/or you may want your series to file in there. <em>webui.browse.index.3 = title:metadata:dc.title,dc:title.uniform,dc:relation.ispartofseries:title:full</em></li>
	<li><b>Separate subject browse.</b> You may want to have a separate subject browse limited to only one type of subject. <em>webui.browse.index.7 = lcsubject.metdata:dc.subject.lcsh.text:single</em><br/>
As one can see, the choices are limited only by your metadata schema, the metadata, and your imagination.</li>
</ul>


<p>Remember to run <em>index-init</em> after adding any new definitions in the <em>dspace.cfg</em> to have the indexes created and the data indexed.</p>



<h2><a name="SystemAdministration-DSpaceLogConverter"></a>DSpace Log Converter</h2>

<p>With the release of DSpace 1.6, new statistics software component was added. DSpace's use of SOLR for statics makes it possible to have a database of statistics. This in mind, there is the issue of the older log files and how a site can use them. The following command process is able to convert the existing log files and then import them for SOLR use. The user will need to perform this only once.</p>

<p>The Log Converter program converts log files from dspace.log into an intermediate format that can be inserted into SOLR.</p>
<div class='table-wrap'>
<table class='confluenceTable'><tbody>
<tr>
<td class='confluenceTd'> Command used: </td>
<td class='confluenceTd'> <tt>[dspace]/bin/dspace stats-log-converter</tt> </td>
</tr>
<tr>
<td class='confluenceTd'> Java class: </td>
<td class='confluenceTd'> org.dspace.statistics.util.ClassicDSpaceLogConverter </td>
</tr>
<tr>
<td class='confluenceTd'> Arguments short and long forms): </td>
<td class='confluenceTd'> Description </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>&#45;i</tt> or <tt>&#45;in</tt> </td>
<td class='confluenceTd'> Input file </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>&#45;o</tt> or <tt>&#45;out</tt> </td>
<td class='confluenceTd'> Output file </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>&#45;m</tt> or <tt>&#45;multiple</tt> </td>
<td class='confluenceTd'> Adds a wildcard at the end of input and output, so it would mean dspace.log&#42; would be converted. (For example, the following files would be included because of this argument: <em>dspace.log, dspace.log.1, dspace.log.2, dspace.log.3,</em> etc.) </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>&#45;n</tt> or <tt>&#45;newformat</tt> </td>
<td class='confluenceTd'> If the log files have been created with DSpace 1.6 </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>&#45;v</tt> or <tt>&#45;verbose</tt> </td>
<td class='confluenceTd'> Display verbose output (helpful for debugging) </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>&#45;h</tt> or <tt>&#45;help</tt> </td>
<td class='confluenceTd'> Help </td>
</tr>
</tbody></table>
</div>


<p>The command loads the intermediate log files that have been created by the aforementioned script into SOLR.</p>
<div class='table-wrap'>
<table class='confluenceTable'><tbody>
<tr>
<td class='confluenceTd'> Command used: </td>
<td class='confluenceTd'> <tt>[dspace]/bin/dspace stats-log-importer</tt> </td>
</tr>
<tr>
<td class='confluenceTd'> Java class: </td>
<td class='confluenceTd'> org.dspace.statistics.util.StatisticsImporter </td>
</tr>
<tr>
<td class='confluenceTd'> Arguments (short and long forms): </td>
<td class='confluenceTd'> Description </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>&#45;i</tt> or <tt>&#45;&#45;</tt> </td>
<td class='confluenceTd'> input file </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>&#45;m</tt> or <tt>&#45;&#45;</tt> </td>
<td class='confluenceTd'> Adds a wildcard at the end of the input, so it would mean dspace.log&#42; would be imported </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>&#45;s</tt> or <tt>&#45;&#45;</tt> </td>
<td class='confluenceTd'> To skip the reverse DNS lookups that work out where a user is from. (The DNS lookup finds the information about the host from its IP address, such as geographical location, etc. This can be slow, and wouldn't work on a server not connected to the internet.) </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>&#45;v</tt> or <tt>&#45;&#45;</tt> </td>
<td class='confluenceTd'> Display verbose ouput (helpful for debugging) </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>&#45;l</tt> or <tt>&#45;&#45;</tt> </td>
<td class='confluenceTd'> For developers: allows you to import a log file from another system, so because the handles won't exist, it looks up random items in your local system to add hits to instead. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>&#45;h</tt> or <tt>&#45;&#45;</tt> </td>
<td class='confluenceTd'> Help </td>
</tr>
</tbody></table>
</div>


<p>Although the DSpace Log Convertor applies basic spider filtering (googlebot, yahoo slurp, msnbot), it is far from complete. Please refer to Statistics Client (8.15) for spider removal operations, after converting your old logs.</p>


<h2><a name="SystemAdministration-ClientStatistics"></a>Client Statistics</h2>

<div class='table-wrap'>
<table class='confluenceTable'><tbody>
<tr>
<td class='confluenceTd'> Command used: </td>
<td class='confluenceTd'> <tt>[dspace]/bin/dspace stats-util</tt> </td>
</tr>
<tr>
<td class='confluenceTd'> Java class: </td>
<td class='confluenceTd'> org.dspace.statistics.util.StatisticsClient </td>
</tr>
<tr>
<td class='confluenceTd'> Arguments (short and long forms): </td>
<td class='confluenceTd'> Description </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>&#45;u</tt> or <tt>&#45;update-spider-files</tt> </td>
<td class='confluenceTd'> Update Spider IP Files from internet into <tt>/dspace/config/spiders</tt>. Downloads Spider files identified in <em>dspace.cfg</em> under property </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>&#45;f</tt> or <tt>&#45;delete-spiders-by-flag</tt> </td>
<td class='confluenceTd'> Delete Spiders in Solr By isBot Flag. Will prune out all records that have <tt>isBot:true</tt> </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>&#45;i</tt> or <tt>&#45;delete-spiders-by-ip</tt> </td>
<td class='confluenceTd'> Delete Spiders in Solr By IP Address. Will prune out all records that have IP's that match spider IPs. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>&#45;m</tt> or <tt>&#45;mark-spiders</tt> </td>
<td class='confluenceTd'> Update isBog Flag in Solr. Marks any records currently stored in statistics that have IP addresses matched in spiders files </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>&#45;h</tt> or <tt>&#45;help</tt> </td>
<td class='confluenceTd'> Calls up this brief help table at CLI. </td>
</tr>
</tbody></table>
</div>


<p>Notes:</p>

<p>The usage of these options is open for the user to choose, If they want to keep spider entires in their repository, they can just mark them using "<tt>&#45;m</tt>" and they will be excluded from statistics queries when "<tt>solr.statistics.query.filter.isBot = true</tt>" in the <tt>dspace.cfg</tt>.</p>

<p>If they want to keep the spiders out of the solr repository, they can run just use the "<tt>&#45;i</tt>" option and they will be removed immediately.</p>

<p>There are guards in place to control what can be defined as an IP range for a bot, in <tt>[dspace]/config/spiders</tt>, spider IP address ranges have to be at least 3 subnet sections in length 123.123.123 and IP Ranges can only be on the smallest subnet [123.123.123.0 - 123.123.123.255]. If not, loading that row will cause exceptions in the dspace logs and exclude that IP entry.</p>


<h2><a name="SystemAdministration-TestDatabase"></a>Test Database</h2>

<p>This command can be used at any time to test for Database connectivity. It will assist in troubleshooting PostgreSQL and Oracle connection issues with the database.</p>
<div class='table-wrap'>
<table class='confluenceTable'><tbody>
<tr>
<td class='confluenceTd'> Command used: </td>
<td class='confluenceTd'> <tt>[dspace]/bin/dspace test-database</tt> </td>
</tr>
<tr>
<td class='confluenceTd'> Java class: </td>
<td class='confluenceTd'> org.dspace.storage.rdbms.DatabaseManager </td>
</tr>
<tr>
<td class='confluenceTd'> Arguments (short and long forms): </td>
<td class='confluenceTd'> Description </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>&#45;</tt> or <tt>&#45;&#45;</tt> </td>
<td class='confluenceTd'> There are no arguments used at this time. </td>
</tr>
</tbody></table>
</div>


<h2><a name="SystemAdministration-Movingitems"></a>Moving items</h2>

<p>It is possible for administrators to move items one at a time using either the JSPUI or the XMLUI.&nbsp; When editing an item, on the 'Edit item' screen select the 'Move Item' option.&nbsp; To move the item, select the new collection for the item to appear in.&nbsp; When the item is moved, it will take its authorizations (who can READ / WRITE it) with it.</p>

<p>If you wish for the item to take on the default authorizations of the destination collection, tick the 'Inherit default policies of destination collection' checkbox.&nbsp; This is useful if you are moving an item from a private collection to a public collection, or from a public collection to a private collection.</p>

<ul>
	<li>Note: When selecting the 'Inherit default policies of destination collection' option, ensure that this will not override system-managed authorizations such as those imposed by the embargo system.</li>
</ul>


<p>Items may also be moved in bulk by using the CSV batch metadata editor (see above).</p>

				    
                    			    </td>
		    </tr>
	    </table>
	    <table border="0" cellpadding="0" cellspacing="0" width="100%">
			<tr>
				<td height="12" background="https://wiki.duraspace.org/images/border/border_bottom.gif"><img src="images/border/spacer.gif" width="1" height="1" border="0"/></td>
			</tr>
		    <tr>
			    <td align="center"><font color="grey">Document generated by Confluence on Mar 25, 2011 19:21</font></td>
		    </tr>
	    </table>
    </body>
</html>